Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Aug 24, 2022

Motivation

  • fixes issue with stats where timestamps might be inconsistent because of visibility issues
  • most timestamps already are volatile, and it's better to follow this approach to prevent field update visibility issues
  • some visibility issues might only be reproducible on certain hardware platforms (multiple CPU sockets, multiple NUMA nodes, etc.) so one cannot be sure about the behavior unless code is made thread safe

Modifications

  • make fields volatile

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

@lhotari lhotari added type/bug The PR fixed a bug or issue reported a bug area/broker doc-not-needed Your PR changes do not impact docs labels Aug 24, 2022
Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Aug 24, 2022
@github-actions
Copy link

@lhotari Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@lhotari lhotari added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Aug 24, 2022
@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker doc-not-needed Your PR changes do not impact docs Stale type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants