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][test] Fix OneWayReplicatorSchemaValidationEnforcedTest racing the replicator's remote topic creation by lhotari · Pull Request #26382 · apache/pulsar Conversation
Member
Motivation
// create the topic and schema in the local cluster (r1) admin1.topics().createNonPartitionedTopic(topicName); admin1.schemas().createSchema(topicName, myClassSchema.getSchemaInfo()); // create the topic and schema in the remote cluster (r2) admin2.topics().createNonPartitionedTopic(topicName); // <-- fails Creating the topic on r1 starts the replicator, and the replicator creates the missing topic on the remote cluster itself, via The test's own The broker request log shows the sequence plainly — the r2 topic is created by the replicator's admin client ( The race has been latent since the test was added. #25437 then added ModificationsCreate the topic and schema on the remote cluster (r2) before creating them on the local cluster (r1), so the replicator finds the remote topic already present and there is nothing to race. This is a reordering only: the test still creates the topic and schema on both clusters before producing, and every assertion is unchanged.
Verifying this change
This change is already covered by existing tests, namely Before this change the class fails 1 of 2 tests; after it, it passed 3 runs out of 3: ./gradlew :pulsar-broker:test -PexcludedTestGroups='' --tests "OneWayReplicatorSchemaValidationEnforcedTest" Does this pull request potentially affect one of the following parts:If the box was checked, please highlight the changes
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…he replicator's remote topic creation ### Motivation `testReplicationWithAvroSchemaWithSchemaValidationEnforced` creates the topic in the local cluster (r1) first and only then in the remote cluster (r2). Creating it on r1 starts the replicator, and the replicator creates the missing topic on the remote cluster itself, via `GeoPersistentReplicator#createRemoteTopicIfDoesNotExist`. The test's own `admin2.topics().createNonPartitionedTopic(...)` therefore races that create and fails with `PulsarAdminException$ConflictException: This topic already exists`. The race has been latent since the test was added. apache#25437 then added `testReplicationReconnectWithSchemaValidationEnforced` to the same class; TestNG runs it first, and it leaves the two-cluster fixture warm, so the older test now loses the race consistently. On a local run it fails on every attempt, in ~0.1s. ### Modifications Create the topic and schema on the remote cluster (r2) before creating them on the local cluster (r1), so the replicator finds the remote topic already present and there is nothing to race. This is a reordering only: the test still creates topic and schema on both clusters before producing, and every assertion is unchanged. `createTopicToRemoteClusterForReplication` is deliberately left at its default. The other test in the class only creates the topic on r1 and relies on the replicator creating it on r2, so turning that off would break it. ### Verifying this change This change is already covered by existing tests. `OneWayReplicatorSchemaValidationEnforcedTest` fails 1 of 2 tests before this change and passes 3 runs out of 3 after it: ``` ./gradlew :pulsar-broker:test -PexcludedTestGroups='' --tests "OneWayReplicatorSchemaValidationEnforcedTest" ``` ### Does this pull request potentially affect one of the following parts: - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment
nodece
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
…he replicator's remote topic creation (apache#26382) (cherry picked from commit bbc02f0)
Radiancebobo
pushed a commit
to Radiancebobo/pulsar
that referenced
this pull request
…he replicator's remote topic creation (apache#26382)
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 assignedProjectsDevelopmentSuccessfully 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. |