Fix compaction logic on infrequent cache snapshots
Fix compaction logic on infrequent cache snapshots

This change fixes #10511 that manifests when a shard is considered cold
faster than its cache is snapshotted. Previously the code only looked at
the last modification of compacted tsm1 files. Instead the (restored)
Engine.lastModified() also takes the cache into account.

Ports #10522 to master where engine.go has moved and Engine.LastModified()
was deleted because it was unused.

mark-rushakoff/influxdb,nooproblem/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdb/influxdb,influxdata/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,li-ang/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,li-ang/influxdb