Skip to content
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

[improve][broker] Use immutable base cursor properties #20400

Merged
merged 1 commit into from
May 25, 2023

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented May 25, 2023

Motivation

  • mutating the singleton base cursor properties accidentally would cause a hard-to-debug bug

Modifications

  • use immutable maps for base cursor properties which are shared singletons

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

- mutating the base cursor properties accidentially would cause a hard-to-debug bug
@lhotari lhotari added type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use ready-to-test labels May 25, 2023
@lhotari lhotari added this to the 3.1.0 milestone May 25, 2023
@lhotari lhotari self-assigned this May 25, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label May 25, 2023
@lhotari lhotari requested a review from tisonkun May 25, 2023 08:11
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM.

Unfortunately the variable still have methods like put that only fail at the runtime.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM.

Unfortunately the variable still have methods like put that only fail at the runtime.

@lhotari
Copy link
Member Author

lhotari commented May 25, 2023

Unfortunately the variable still have methods like put that only fail at the runtime.

@tisonkun where do you see this?

@tisonkun
Copy link
Member

tisonkun commented May 25, 2023

@lhotari No. There is no issue in the current codebase.

I expect that when you view REPLICATED_SUBSCRIPTION_CURSOR_PROPERTIES at its use point, you still don't know it's immutable and can call put on the variable, which doesn't cause compile error but fail at runtime.

@lhotari lhotari merged commit f0e97f4 into apache:master May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants