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

[Issue 12723] Fix race condition in PersistentTopic#addReplicationCluster #12729

Merged
merged 2 commits into from
Nov 15, 2021

Conversation

Jason918
Copy link
Contributor

@Jason918 Jason918 commented Nov 10, 2021

Fixes #12723

Motivation

See #12723

Modifications

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value in a thread safe way.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • org.apache.pulsar.common.util.collections.ConcurrentOpenHashMapTest#testNullValue

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • no-need-doc

Bug fix.

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 10, 2021
@Jason918
Copy link
Contributor Author

@codelipenghui @linlinnn @hangc0276 PTAL

@codelipenghui codelipenghui added this to the 2.10.0 milestone Nov 11, 2021
@codelipenghui codelipenghui merged commit a3fe00e into apache:master Nov 15, 2021
codelipenghui pushed a commit that referenced this pull request Nov 18, 2021
…ster (#12729)

See #12723

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value   in a thread safe way.

(cherry picked from commit a3fe00e)
@codelipenghui codelipenghui added cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.2 and removed release/2.8.3 labels Nov 18, 2021
@SuppressFBWarnings
@Override
public boolean equals(Object obj) {
return obj == null;
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a solution that violates the contract of Object.equals. Isn't there an alternative way to achieve the desired outcome?

Copy link
Member

Choose a reason for hiding this comment

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

found this comment as context: #12723 (comment) .

@merlimat would you be able to take a look at the problem and this solution?

eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
…ster (apache#12729)

### Motivation

See apache#12723

### Modifications

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value   in a thread safe way.
lhotari pushed a commit to datastax/pulsar that referenced this pull request Dec 3, 2021
…ster (apache#12729)

See apache#12723

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value   in a thread safe way.

(cherry picked from commit a3fe00e)
(cherry picked from commit 230e1ac)
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
…ster (apache#12729)

### Motivation

See apache#12723

### Modifications

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value   in a thread safe way.
codelipenghui pushed a commit that referenced this pull request Dec 20, 2021
…ster (#12729)

See #12723

Add a method org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap#removeNullValue to remove null value   in a thread safe way.

(cherry picked from commit a3fe00e)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.2 release/2.9.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition in PersistentTopic#addReplicationCluster
5 participants