Skip to content

Conversation

@lordcheng10
Copy link
Contributor

@lordcheng10 lordcheng10 commented Sep 22, 2022

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
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
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
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
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
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
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
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
Copy link
Contributor

@Jason918 Jason918 left a comment

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
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.

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

@lordcheng10
Copy link
Contributor Author

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

OK

@lordcheng10
Copy link
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
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

@lordcheng10
Copy link
Contributor Author

CI passed: lordcheng10#17

Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

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

LGTM

@lordcheng10
Copy link
Contributor Author

@codelipenghui @Technoboy- PTAL,thanks!

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

@aloyszhang PTAL,thanks!

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

3 similar comments
@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@lordcheng10
Copy link
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
Contributor Author

@codelipenghui @Technoboy- PTAL,thanks!

@lordcheng10
Copy link
Contributor Author

@AnonHxy PTAL,thanks!

@AnonHxy
Copy link
Contributor

AnonHxy commented Oct 9, 2022

LGTM now

@lordcheng10
Copy link
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