-
Notifications
You must be signed in to change notification settings - Fork 3.7k
PIP-45: Migrate OwnershipCache to use MetadataStore #11012
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
Conversation
eolivelli
left a comment
There was a problem hiding this 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)) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
@merlimat thanks for your contribution. For this PR, do we need to update docs? |
No docs updates, this is just an internal refactoring. |
eolivelli
left a comment
There was a problem hiding this 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
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 |
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.
* 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
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.
… 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.
Motivation
Migrate OwnershipCache logic for acquiring and watching bundles ownership to use ResourceLocks from the MetadataStore interface.