Skip to content

[fix][broker] Update new bundle-range to policies after bundle split - #17797

Merged
AnonHxy merged 2 commits into
apache:masterfrom
lordcheng10:update_policies_after_split
Oct 9, 2022
Merged

[fix][broker] Update new bundle-range to policies after bundle split#17797
AnonHxy merged 2 commits into
apache:masterfrom
lordcheng10:update_policies_after_split

Conversation

@lordcheng10

@lordcheng10 lordcheng10 commented Sep 22, 2022

Copy link
Copy Markdown
Contributor

Motivation

After the bundle is split, update the new bundle information to admin/policies.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

Matching PR in forked repository

PR in forked repository: lordcheng10#17

for (NamespaceBundle sBundle : splittedBundles.getRight()) {
checkNotNull(ownershipCache.tryAcquiringOwnership(sBundle));
}
updateNamespaceBundlesForPolicies(nsname, splittedBundles.getLeft())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about update updateNamespaceBundlesForPolicies success but updateNamespaceBundles fail?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Modify the execution order of the two methods to ensure that updateNamespaceBundlesForPolicies is executed after updateNamespaceBundles is completed.
@mattisonchao PTAL,thanks!

@lordcheng10
lordcheng10 requested review from Jason918 and mattisonchao and removed request for Jason918 September 30, 2022 03:58
+ "NamespaceBundle: %s due to %s",
nsname.toString(), bundle.getBundleRange(), e.getMessage());
LOG.warn(msg);
updateFuture.completeExceptionally(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder what will happen if updateFuture completeExceptionally here and complete success in L896(after updateNamespaceBundles success). There is no executing order guarantee for these two ops.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder what will happen if updateFuture completeExceptionally here and complete success in L896(after updateNamespaceBundles success).

Local policies were updated successfully, but policies update failed.

There is no executing order guarantee for these two ops.

I can add an order guarantee: updateNamespaceBundlesForPolicies is only executed after updateNamespaceBundles is executed successfully.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I add an order guarantee: updateNamespaceBundlesForPolicies is only executed after updateNamespaceBundles is executed successfully!

@Jason918 PTAL,thanks!

@@ -884,15 +884,28 @@ void splitAndOwnBundleOnceAndRetry(NamespaceBundle bundle,
.thenRun(() -> {
bundleFactory.invalidateBundleCache(bundle.getNamespaceObject());
updateFuture.complete(splittedBundles.getRight());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems updateFuture should complete after updateNamespaceBundlesForPolicies completes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed,PTAL,thanks! @Jason918

@lordcheng10
lordcheng10 requested review from Jason918 and removed request for mattisonchao October 2, 2022 01:54

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lordcheng10
lordcheng10 force-pushed the update_policies_after_split branch from 6562742 to 438750e Compare October 2, 2022 07:56

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add some test to cover this change and also to demonstrate the problem?

@lordcheng10

Copy link
Copy Markdown
Contributor Author

Can we add some test to cover this change and also to demonstrate the problem?

OK

@lordcheng10

Copy link
Copy Markdown
Contributor Author

Can we add some test to cover this change and also to demonstrate the problem?

Fixed! PTAL,thanks! @eolivelli
update NamespaceServiceTest#testSplitAndOwnBundles to check policies updating.

@lordcheng10
lordcheng10 requested review from eolivelli and removed request for mattisonchao October 5, 2022 09:03

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

@lordcheng10

Copy link
Copy Markdown
Contributor Author

CI passed: lordcheng10#17

@mattisonchao mattisonchao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lordcheng10

Copy link
Copy Markdown
Contributor Author

@codelipenghui @Technoboy- PTAL,thanks!

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10

Copy link
Copy Markdown
Contributor Author

@aloyszhang PTAL,thanks!

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

3 similar comments
@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
lordcheng10 force-pushed the update_policies_after_split branch from 18136c1 to 27c16c0 Compare October 8, 2022 14:03
@lordcheng10

Copy link
Copy Markdown
Contributor Author

@codelipenghui @Technoboy- PTAL,thanks!

@lordcheng10

Copy link
Copy Markdown
Contributor Author

@AnonHxy PTAL,thanks!

@AnonHxy

AnonHxy commented Oct 9, 2022

Copy link
Copy Markdown
Contributor

LGTM now

@lordcheng10

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@AnonHxy
AnonHxy merged commit 7df4ee9 into apache:master Oct 9, 2022
shibd pushed a commit to shibd/pulsar that referenced this pull request Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants