You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "Marcosrico (via GitHub)" <gi...@apache.org> on 2023/06/05 22:37:17 UTC
[GitHub] [helix] Marcosrico opened a new pull request, #2523: [helix/metaclient] ZkMetaClient Stress Tests (Part 2)
Marcosrico opened a new pull request, #2523:
URL: https://github.com/apache/helix/pull/2523
### Issues
- [ ] My PR addresses the following Helix issues and references them in the PR description:
https://github.com/apache/helix/issues/2237
### Description
- [ ] Here are some details about my PR, including screenshots of any UI changes:
Stress tests for the the the ZooKeeper metaclient
This is part two of the stress tests, future pr's will include tests for multi-threaded stress tests.
### Tests
- [ ] The following tests are written for this issue:
Tests created for following methods:
Create and renew TTL, transaction Op.
- The following is the result of the "mvn test" command on the appropriate module:
(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)
### Commits
- My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Code Quality
- My diff has been formatted using helix-style.xml
(helix-style-intellij.xml if IntelliJ IDE is used)
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] xyuanlu merged pull request #2523: [helix/metaclient] ZkMetaClient Stress Tests (Part 2)
Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu merged PR #2523:
URL: https://github.com/apache/helix/pull/2523
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] Marcosrico commented on pull request #2523: [helix/metaclient] ZkMetaClient Stress Tests (Part 2)
Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on PR #2523:
URL: https://github.com/apache/helix/pull/2523#issuecomment-1581333615
PR approved by @xyuanlu
Commit message: ZkMetaClient Stress Tests (Part 2)
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] Marcosrico commented on a diff in pull request #2523: [helix/metaclient] ZkMetaClient Stress Tests (Part 2)
Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2523:
URL: https://github.com/apache/helix/pull/2523#discussion_r1220055547
##########
meta-client/src/test/java/org/apache/helix/metaclient/impl/zk/TestStressZkClient.java:
##########
@@ -369,4 +383,47 @@ public void handleDataChange(String key, Object data, ChangeType changeType) {
_zkMetaClient.recursiveDelete(zkParentKey);
Assert.assertEquals(_zkMetaClient.countDirectChildren(zkParentKey), 0);
}
+
+ @Test
+ public void testTransactionOps() {
+ String zkParentKey = "/stressZk_testTransactionOp";
+ _zkMetaClient.create(zkParentKey, "parent_node");
+
+ // Transaction Create
+ List<Op> ops = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops.add(Op.create(zkParentKey + "/" + i, new byte[0], PERSISTENT));
+ }
+ List<OpResult> opResults = _zkMetaClient.transactionOP(ops);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opResults.get(i) instanceof OpResult.CreateResult);
+ }
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertNotNull(_zkMetaClient.exists(zkParentKey + "/" + i));
+ }
+
+ // Transaction Set
+ List<Op> ops_set = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops_set.add(Op.set(zkParentKey + "/" + i, new byte[0], -1));
+ }
+ List<OpResult> opsResultSet = _zkMetaClient.transactionOP(ops_set);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opsResultSet.get(i) instanceof OpResult.SetDataResult);
+ }
+
+ // Transaction Delete
+ List<Op> ops_delete = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops_delete.add(Op.delete(zkParentKey + "/" + i, -1));
+ }
+ List<OpResult> opsResultDelete = _zkMetaClient.transactionOP(ops_delete);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opsResultDelete.get(i) instanceof OpResult.DeleteResult);
+ }
Review Comment:
Just added, thanks for the comment!
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org
[GitHub] [helix] xyuanlu commented on a diff in pull request #2523: [helix/metaclient] ZkMetaClient Stress Tests (Part 2)
Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu commented on code in PR #2523:
URL: https://github.com/apache/helix/pull/2523#discussion_r1218723399
##########
meta-client/src/test/java/org/apache/helix/metaclient/impl/zk/TestStressZkClient.java:
##########
@@ -369,4 +383,47 @@ public void handleDataChange(String key, Object data, ChangeType changeType) {
_zkMetaClient.recursiveDelete(zkParentKey);
Assert.assertEquals(_zkMetaClient.countDirectChildren(zkParentKey), 0);
}
+
+ @Test
+ public void testTransactionOps() {
+ String zkParentKey = "/stressZk_testTransactionOp";
+ _zkMetaClient.create(zkParentKey, "parent_node");
+
+ // Transaction Create
+ List<Op> ops = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops.add(Op.create(zkParentKey + "/" + i, new byte[0], PERSISTENT));
+ }
+ List<OpResult> opResults = _zkMetaClient.transactionOP(ops);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opResults.get(i) instanceof OpResult.CreateResult);
+ }
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertNotNull(_zkMetaClient.exists(zkParentKey + "/" + i));
+ }
+
+ // Transaction Set
+ List<Op> ops_set = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops_set.add(Op.set(zkParentKey + "/" + i, new byte[0], -1));
+ }
+ List<OpResult> opsResultSet = _zkMetaClient.transactionOP(ops_set);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opsResultSet.get(i) instanceof OpResult.SetDataResult);
+ }
+
+ // Transaction Delete
+ List<Op> ops_delete = new ArrayList<>();
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ ops_delete.add(Op.delete(zkParentKey + "/" + i, -1));
+ }
+ List<OpResult> opsResultDelete = _zkMetaClient.transactionOP(ops_delete);
+ for (int i = 0; i < TEST_ITERATION_COUNT; i++) {
+ Assert.assertTrue(opsResultDelete.get(i) instanceof OpResult.DeleteResult);
+ }
Review Comment:
Do we have any negative test?
--
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: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org