-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use nanosecond precision for timestamp in compacted tsdb index file names #12502
Conversation
@@ -79,7 +79,7 @@ func (i SingleTenantTSDBIdentifier) Hash(h hash.Hash32) (err error) { | |||
func (i SingleTenantTSDBIdentifier) str() string { | |||
return fmt.Sprintf( | |||
"%d-%s-%d-%d-%x.tsdb", | |||
i.TS.Unix(), | |||
i.TS.UnixNano(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. Can you also get an approval from blooms folks? I wonder if we do any filename parsing assuming it's seconds precision anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. As far as I can tell, blooms only use ParseSingleTenantTSDBPath
.
What this PR does / why we need it:
Do the same changes as PR #11277, i.e., have a creation timestamp in compacted index files with nanosecond precision instead of seconds. I had only made that change for
boltdb-shipper
and skipped changingtsdb
sincetsdb
index file names have checksums in them. However, as seen in issue #12500, we can hit the bug if compaction happens twice in the same unix second, and it ends up having the same contents in the compacted index(hence the same checksum as well).Which issue(s) this PR fixes:
Fixes #12500
Checklist