-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Bloomshipper: Use model.Time
in MetaRef
and BlockRef
#11566
Conversation
Trivy scan found the following vulnerabilities:
|
@@ -33,20 +33,28 @@ type Ref struct { | |||
TenantID string | |||
TableName string | |||
MinFingerprint, MaxFingerprint uint64 | |||
StartTimestamp, EndTimestamp int64 | |||
StartTimestamp, EndTimestamp int64 // must be millisecond precision timestamp aka model.Time |
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.
It would make even more sense to use model.Time
type.
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.
I agree 👍
MinFingerprint: job.minFp, | ||
MaxFingerprint: job.maxFp, |
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.
doesn't this complain? min/maxFp
are model.Fingerprint
StartTimestamp int64 | ||
EndTimestamp int64 | ||
TenantID string | ||
MinFingerprint, MaxFingerprint model.Fingerprint |
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.
I think it's good to use model.Fingerprint
here instead of uint64
If you are changing fp
here, maybe change above in Ref
struct too?
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.
Yes, we can change it in the Ref as well. I would create a separate PR for that, though.
model.Time
in MetaRef
and BlockRef
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
The `Ref` of `MetaRef` and `BlockRef` do have start and end timestamps, which are of type `int64`. This however, can lead to the problem that different components might use different precisions (`s`, `ms`, `ns`) for these timestamps. This PR changes the current implementation of the bloom shipper to use `ms` precision timestamps (using `model.Time`) instead of `s`, to match the behaviour that we have to encode ChunkRefs to object store keys. Signed-off-by: Christian Haudum <[email protected]>
0d4d250
to
844563c
Compare
…1566) The `Ref` of `MetaRef` and `BlockRef` do have start and end timestamps, which are of type `int64`. This however, can lead to the problem that different components might use different precisions (`s`, `ms`, `ns`) for these timestamps. This PR changes the current implementation of the bloom shipper to use `ms` precision timestamps (using `model.Time`) instead of `s`, to match the behaviour that we have to encode ChunkRefs to object store keys. Signed-off-by: Christian Haudum <[email protected]>
What this PR does / why we need it:
The
Ref
ofMetaRef
andBlockRef
do have start and end timestamps, which are of typeint64
.This however, can lead to the problem that different components might use different precisions (
s
,ms
,ns
) for these timestamps.This PR changes the current implementation of the bloom shipper to use
ms
precision timestamps (usingmodel.Time
) instead ofs
, to match the behaviour that we have to encode ChunkRefs to object store keys.