PIP-45: Migrate OwnershipCache to use MetadataStore#11012
Conversation
eolivelli
left a comment
There was a problem hiding this comment.
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.
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
|
@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.
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.