Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use nanosecond precision for timestamp in compacted boltdb-shipper in…
…dex file names (grafana#11277) **What this PR does / why we need it**: In PR grafana#9884, we split the compaction and retention loop to run them concurrently. Although we make sure we do not work on the same index from compaction and retention loop, there is a chance that one could run immediately after the other and finish quickly enough to build the index with the same name as the previous one because in `boltdb-shipper` index, we use epoch with `Seconds` precision while building the name of the compacted index file. Since compaction uploads the new file first and then deletes the old file, if the index is built with the same name, we end up uploading the file and deleting it afterwards. This PR fixes the issue by using ns precision for the timestamp in the filenames. **Special notes for your reviewer**: This is not a problem for TSDB since we also add a checksum to the filenames of the index during compaction.
- Loading branch information