You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/10/22 11:17:42 UTC
[PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
adoroszlai opened a new pull request, #5476:
URL: https://github.com/apache/ozone/pull/5476
## What changes were proposed in this pull request?
Fix intermittent error in `testAllVolumeOperations`: `OMNotLeaderException: OM:omNode-1 is not the leader. Suggested leader is OM:omNode-2[localhost/127.0.0.1].`
`TestOzoneManagerHA` subclasses use a single cluster for all tests, and all OM instances are restarted after each test case.
The patch makes 3 main changes:
1. add "wait for OM leader election" before each test case
2. mark all OMs as active when restarting them (HA mini cluster keeps track of active and inactive OMs. OM stopped via `stopOzoneManager()` is marked as inactive. Before this change `restartOzoneManager()` still starts all OMs, even inactive ones. But `getLeaderOM()` only considers active ones, thus we may not find the actual leader if it is left as "inactive".)
3. wait for OM RPC server to really stop (call `join()`) when restarting OM. Avoid calling `join()` if OM is already stopped, as that would wait for `notifyAll()` without anyone signalling.
https://issues.apache.org/jira/browse/HDDS-9429
## How was this patch tested?
`TestOzoneManagerHAMetadataOnly` passed in 300 runs:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/6602838480
On `master` it failed in 17/300 runs:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/6602302723/job/17935202601
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369717408
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java:
##########
@@ -470,4 +481,12 @@ protected void createKeyTest(boolean checkSuccess) throws Exception {
}
}
+ protected void waitForLeaderToBeReady()
Review Comment:
Good point. Let's move it and clean up related code in a followup.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369703796
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java:
##########
@@ -202,7 +201,7 @@ public void testPrepareWithRestart() throws Exception {
// modified cluster.
shutdown();
init();
- setup();
+ initInstanceVariables();
Review Comment:
This was the old code:
```
// Create fresh cluster for this test to prevent timeout from restarting
// modified cluster.
shutdown();
init();
setup();
... (test)
```
Basically it re-runs `@AfterAll` and `@BeforeAll` manually for this test case, but then does not call the `@BeforeEach` method, rather only a specific part of it. Normally the code in `@BeforeEach` stores `cluster` etc. in instance variables, _and_ performs other steps. I guess we want to avoid those other steps for this specific test case.
The only change in this test case is that `TestOzoneManagerPrepare.setup()` was renamed to `initInstanceVariables()` because it conflicted with the new `setup()` method from parent class.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "hemantk-12 (via GitHub)" <gi...@apache.org>.
hemantk-12 commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1370500688
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java:
##########
@@ -202,7 +201,7 @@ public void testPrepareWithRestart() throws Exception {
// modified cluster.
shutdown();
init();
- setup();
+ initInstanceVariables();
Review Comment:
I found https://github.com/apache/ozone/pull/2689/files#r718204488 and it says it is done this way to prevent CI from timing out. Though I fully don't understand it how.
Since your change is just changing method name, it is OK to leave as it.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369703796
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java:
##########
@@ -202,7 +201,7 @@ public void testPrepareWithRestart() throws Exception {
// modified cluster.
shutdown();
init();
- setup();
+ initInstanceVariables();
Review Comment:
This was the old code:
```
// Create fresh cluster for this test to prevent timeout from restarting
// modified cluster.
shutdown();
init();
setup();
... (test)
```
Basically it re-runs `@AfterAll` and `@BeforeAll` manually for this test case, but then does not call the `@BeforeEach` method (`initOM()`), rather only a specific part of it (`setup()`). The code in `initOM()` stores `cluster` etc. in instance variables (by calling `setup()`), _and_ performs other steps. I guess we want to avoid those other steps for this specific test case.
The only change in this test case is that `TestOzoneManagerPrepare.setup()` was renamed to `initInstanceVariables()` because it conflicted with the new `setup()` method from parent class. The reason for renaming `initOM()` to `setup()` is to avoid having two `@BeforeEach` methods.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369703796
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java:
##########
@@ -202,7 +201,7 @@ public void testPrepareWithRestart() throws Exception {
// modified cluster.
shutdown();
init();
- setup();
+ initInstanceVariables();
Review Comment:
This was the old code:
```
// Create fresh cluster for this test to prevent timeout from restarting
// modified cluster.
shutdown();
init();
setup();
... (test)
```
Basically it re-runs `@AfterAll` and `@BeforeAll` manually for this test case, but then does not call the `@BeforeEach` method (`initOM()`), rather only a specific part of it (`setup()`). Normally the code in `@BeforeEach` stores `cluster` etc. in instance variables, _and_ performs other steps. I guess we want to avoid those other steps for this specific test case.
The only change in this test case is that `TestOzoneManagerPrepare.setup()` was renamed to `initInstanceVariables()` because it conflicted with the new `setup()` method from parent class.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369751982
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java:
##########
@@ -470,4 +481,12 @@ protected void createKeyTest(boolean checkSuccess) throws Exception {
}
}
+ protected void waitForLeaderToBeReady()
Review Comment:
Created HDDS-9524.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #5476:
URL: https://github.com/apache/ozone/pull/5476#issuecomment-1777645465
Thanks @hemantk-12 for the review.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "hemantk-12 (via GitHub)" <gi...@apache.org>.
hemantk-12 commented on code in PR #5476:
URL: https://github.com/apache/ozone/pull/5476#discussion_r1369653608
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java:
##########
@@ -470,4 +481,12 @@ protected void createKeyTest(boolean checkSuccess) throws Exception {
}
}
+ protected void waitForLeaderToBeReady()
Review Comment:
nit: should we add it to `MiniOzoneHAClusterImpl` so that it could be used by others?
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java:
##########
@@ -202,7 +201,7 @@ public void testPrepareWithRestart() throws Exception {
// modified cluster.
shutdown();
init();
- setup();
+ initInstanceVariables();
Review Comment:
Why do we need to call `initInstanceVariables` here again if we are using `@BeforeEach`?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-9429. Intermittent error in TestOzoneManagerHAMetadataOnly#testAllVolumeOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #5476:
URL: https://github.com/apache/ozone/pull/5476
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org