GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [fix][broker] Delete the schema and topic policies when another cluster deletes the partitioned topic metadata first during GC by merlimat · Pull Request #27588 · apache/pulsar Conversation
Contributor
Motivation
This is a broker bug, not a test bug. With a shared configuration store (global ZK), the clusters share the partitioned topic metadata, but each cluster has its own schema and topic policies. When a partition goes inactive,
Both clusters' replicators go idle at the same moment, so both clusters GC their partition within about 100 ms of each other. If cluster r1 deletes the shared metadata after r2 has checked that it exists, but before r2's admin call reads it, that call returns 404: Then r2's GC chain fails and r2's schema and topic policies are never deleted. r2's partition is already gone, so GC never visits the topic again. In production, a partitioned topic recreated later with the same name picks up the stale policies and schema. The race is old. #27537 made the test hit it more often: the test's GC interval went from 5 s to 1 s, so the two clusters' GC passes land close together far more often. Modifications
).exceptionallyCompose(ex -> { if (FutureUtil.unwrapCompletionException(ex) instanceof NotFoundException) { // Another broker deleted the partitioned topic metadata first, ... return deleteSchemaAndPoliciesIfAllPartitionsDeleted(); } return CompletableFuture.failedFuture(ex); });
Verifying this change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…er deletes the partitioned topic metadata first during GC With a shared configuration store (global ZK), the partitioned topic metadata is shared by the clusters, while the schema and topic policies are per cluster. When both clusters GC their copy of an inactive partition at about the same time, the one that loses the race to delete the partitioned topic metadata gets a 404 from its own deletePartitionedTopic call: the deletion fails, and its schema and topic policies are left behind for good since the partition is already gone and GC never visits it again. Treat a NotFoundException from that deletion as "the metadata is already gone" and delete this cluster's schema and topic policies as the branch for missing metadata already does. This made ReplicationTopicGcUsingGlobalZKTest.testTopicGC[partitioned] flaky: since apache#27537 the GC runs every second, so both clusters' GC passes land close together far more often.
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…er deletes the partitioned topic metadata first during GC (apache#27588) (cherry picked from commit f918744)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…er deletes the partitioned topic metadata first during GC (apache#27588) (cherry picked from commit f918744)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |