You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "liangyepianzhou (via GitHub)" <gi...@apache.org> on 2023/03/05 08:28:08 UTC
[GitHub] [pulsar] liangyepianzhou opened a new pull request, #19715: [fix][test]testRedirectOfGetCoordinatorInternalStats
liangyepianzhou opened a new pull request, #19715:
URL: https://github.com/apache/pulsar/pull/19715
Fix https://github.com/apache/pulsar/issues/18600
### Motivation
Reason for test failure:
1. Create 16 brokers and 3 transaction coordinator topics.
2. The 3 transaction coordinator topics are assigned to broker-0.
3. Because the admin is connected to broker-0, we do not hope the topics are assigned to broker-0.
4. Recreate the 3 transaction coordinator topics.
5. The topics are assigned to broker-0 again.
6. Repeat execute steps 3,4,5
7. Timeout
### Modifications
Do not recreate the transaction coordinator topics.
Recreate an admin connect the broker which is not the owner of the transaction coordinator topics.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] 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
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] liangyepianzhou closed pull request #19715: [fix][test]testRedirectOfGetCoordinatorInternalStats
Posted by "liangyepianzhou (via GitHub)" <gi...@apache.org>.
liangyepianzhou closed pull request #19715: [fix][test]testRedirectOfGetCoordinatorInternalStats
URL: https://github.com/apache/pulsar/pull/19715
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19715: [fix][test]testRedirectOfGetCoordinatorInternalStats
Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on code in PR #19715:
URL: https://github.com/apache/pulsar/pull/19715#discussion_r1126039184
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v3/AdminApiTransactionMultiBrokerTest.java:
##########
@@ -46,21 +47,25 @@ protected void cleanup() throws Exception {
super.internalCleanup();
}
+ /**
+ * This test is used to verify the redirect request of `getCoordinatorInternalStats`.
+ * <p>
+ * 1. Set up 16 broker and create 3 transaction coordinator topic.
+ * 2. The 3 transaction coordinator topic will be assigned to these brokers through some kind of
+ * load-balancing strategy. (In current implementations, they tend to be assigned to a broker.)
+ * 3. Find a broker x which is not the owner of the transaction coordinator topic.
+ * 4. Create a admin connected to broker x, and use the admin to call ` getCoordinatorInternalStats`.
+ * </p>
+ */
@Test
public void testRedirectOfGetCoordinatorInternalStats() throws Exception {
Map<String, String> map = admin.lookups()
.lookupPartitionedTopic(SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN.toString());
- while (map.containsValue(getPulsarServiceList().get(0).getBrokerServiceUrl())) {
- pulsarServiceList.get(0).getPulsarResources()
- .getNamespaceResources()
- .getPartitionedTopicResources()
- .deletePartitionedTopicAsync(SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN);
- pulsarServiceList.get(0).getPulsarResources()
- .getNamespaceResources()
- .getPartitionedTopicResources()
- .createPartitionedTopic(SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN,
- new PartitionedTopicMetadata(NUM_PARTITIONS));
- map = admin.lookups().lookupPartitionedTopic(SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN.toString());
+
+ for (int i = 0; map.containsValue(getPulsarServiceList().get(i).getBrokerServiceUrl()); i++) {
Review Comment:
Why not create a new `admin` connected to the broker who not contains the TXN coordinator?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] liangyepianzhou merged pull request #19715: [fix][test]testRedirectOfGetCoordinatorInternalStats
Posted by "liangyepianzhou (via GitHub)" <gi...@apache.org>.
liangyepianzhou merged PR #19715:
URL: https://github.com/apache/pulsar/pull/19715
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org