Repository navigation
[fix][broker] Make timestamp fields thread safe by using volatile to prevent visibility issues - #17252
Merged
Conversation
lhotari
requested review from
codelipenghui,
eolivelli,
merlimat,
michaeljmarshall,
nicoloboschi and
zymap
August 24, 2022 04:49
michaeljmarshall
approved these changes
Aug 24, 2022
michaeljmarshall
left a comment
Member
There was a problem hiding this comment.
LGTM. I know this is a break from the previous order, but I think it is important for the correctness of the metrics, which are important for verifying the system's correctness.
|
@lhotari Please provide a correct documentation label for your PR. |
eolivelli
approved these changes
Aug 24, 2022
nicoloboschi
approved these changes
Aug 24, 2022
dlg99
approved these changes
Aug 24, 2022
|
The pr had no activity for 30 days, mark with Stale label. |
1 task done
- fixes issue with stats where timestamps might be inconsistent because of visibility issues - fields should be volatile to ensure visibility of updated values in a consistent manner - in replication, the lastDataMessagePublishedTimestamp field in PersistentTopic might be inconsistent unless volatile is used
lhotari
force-pushed
the
lh-fix-stats-threadsafety
branch
from
September 28, 2022 09:07
eea55c4 to
e231f4e
Compare
Merged
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Modifications
Additional context
In Pulsar code base some stats intentionally don't use volatile as explained by @merlimat in this comment. The goal of this PR is to ensure consistently by deliberately making the fields volatile and not to rely on "best efforts" type of stats.
doc-not-needed