Skip to content

Conversation

@merlimat
Copy link
Contributor

Motivation

Migrate OwnershipCache logic for acquiring and watching bundles ownership to use ResourceLocks from the MetadataStore interface.

@merlimat merlimat added this to the 2.9.0 milestone Jun 22, 2021
@merlimat merlimat self-assigned this Jun 22, 2021
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.

I did a first pass.
the patch is very big and I am not used to this code but overall it looks good

boolean replicatedSubscriptionStateArg,
KeySharedMeta keySharedMeta) {
return brokerService.checkTopicNsOwnership(getName()).thenCompose(__ -> {
if (readCompacted && !(subType == SubType.Failover || subType == SubType.Exclusive)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we could move this validation outside of the checkTopicNsOwnership block.
not a big deal, it is something that does not happen in the happy path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Anonymitaet
Copy link
Member

@merlimat thanks for your contribution. For this PR, do we need to update docs?

@merlimat
Copy link
Contributor Author

@merlimat thanks for your contribution. For this PR, do we need to update docs?

No docs updates, this is just an internal refactoring.

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.

LGTM
I see that the patch contains the fix on MLTransactionLog

we can merge that patch and then rebase this one

@merlimat
Copy link
Contributor Author

merlimat commented Jul 2, 2021

I see that the patch contains the fix on MLTransactionLog

Yes, I've added here to make sure all the other tests were fine. I'll rebase on master once the other one is merged

@merlimat merlimat merged commit 794aa20 into apache:master Jul 2, 2021
@merlimat merlimat deleted the ownership-cache branch July 2, 2021 16:56
codelipenghui pushed a commit that referenced this pull request Sep 22, 2021
Link PR in KoP:
streamnative/kop#718 and [failed test unit](https://github.com/streamnative/kop/pull/718/checks?check_run_id=3541827178#step:5:353)

### Motivation
The bug cause by #11012, the `loadOrCreatePersistentTopic` has uncaught exception may cause `getTopic` hang.

### Modifications

Caught the exception

### Verifying this change

The [unit test](#11290) added by @kaushik-develop help to isolate and reproduce the issue.

### Documentation
- [x] no-need-doc 
  
This is a bug fix, no need documentation.
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
* PIP-45: Migrate OwnershipCache to use MetadataStore

* Import checkstyle

* Fixed typo

* Addressed comment

* Fixed test

* Test fixes

* One more test fix

* Fixed possible deadlock in the initialization of MLTransactionLog

* Fixed tests
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
Link PR in KoP:
streamnative/kop#718 and [failed test unit](https://github.com/streamnative/kop/pull/718/checks?check_run_id=3541827178#step:5:353)

### Motivation
The bug cause by apache#11012, the `loadOrCreatePersistentTopic` has uncaught exception may cause `getTopic` hang.

### Modifications

Caught the exception

### Verifying this change

The [unit test](apache#11290) added by @kaushik-develop help to isolate and reproduce the issue.

### Documentation
- [x] no-need-doc 
  
This is a bug fix, no need documentation.
BewareMyPower added a commit to BewareMyPower/pulsar that referenced this pull request Apr 11, 2024
… creating OwnershipCache

### Motivation

apache#11012 removes all uses of the
`NamespaceBundleFactory` field in `OwnershipCache` and
apache#17768 removes that field. However,
the constructor of `OwnershipCache` still has the
`NamespaceBundleFactory` parameter.

### Modifications

Remove that parameter from the constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants