-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-25282 Remove processingServers in DeadServer as we can get this… #2657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1552d28
HBASE-25282 Remove processingServers in DeadServer as we can get this…
yuqi1129 71b3b5e
HBASE-25282 Remove processingServers in DeadServer as we can get this…
yuqi1129 bf60ce6
HBASE-25282 Remove processingServers in DeadServer as we can get this…
yuqi1129 9613660
HBASE-25282 Remove processingServers in DeadServer as we can get this…
yuqi1129 b29e0b7
Merge branch 'master' of https://github.com/apache/hbase into 25282
yuqi1129 d9d4a48
Merge branch '25282' of https://github.com/yuqi1129/hbase into 25282
yuqi1129 0b46693
HBASE-25282 Remove processingServers in DeadServer as we can get this…
yuqi1129 e146b30
Fix checkstyle problem
yuqi1129 95031fb
Fix checkstyle problem again
yuqi1129 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| import static org.junit.Assert.assertFalse; | ||
| import static org.junit.Assert.assertTrue; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
| import org.apache.hadoop.hbase.HBaseClassTestRule; | ||
|
|
@@ -68,22 +69,10 @@ public static void tearDownAfterClass() throws Exception { | |
| @Test public void testIsDead() { | ||
| DeadServer ds = new DeadServer(); | ||
| ds.putIfAbsent(hostname123); | ||
| ds.processing(hostname123); | ||
| assertTrue(ds.areDeadServersInProgress()); | ||
| ds.finish(hostname123); | ||
| assertFalse(ds.areDeadServersInProgress()); | ||
|
|
||
| ds.putIfAbsent(hostname1234); | ||
| ds.processing(hostname1234); | ||
| assertTrue(ds.areDeadServersInProgress()); | ||
| ds.finish(hostname1234); | ||
| assertFalse(ds.areDeadServersInProgress()); | ||
|
|
||
| ds.putIfAbsent(hostname12345); | ||
| ds.processing(hostname12345); | ||
| assertTrue(ds.areDeadServersInProgress()); | ||
| ds.finish(hostname12345); | ||
| assertFalse(ds.areDeadServersInProgress()); | ||
|
|
||
| // Already dead = 127.0.0.1,9090,112321 | ||
| // Coming back alive = 127.0.0.1,9090,223341 | ||
|
|
@@ -104,15 +93,15 @@ public static void tearDownAfterClass() throws Exception { | |
| } | ||
|
|
||
| @Test | ||
| public void testCrashProcedureReplay() { | ||
| public void testCrashProcedureReplay() throws IOException { | ||
| HMaster master = TEST_UTIL.getHBaseCluster().getMaster(); | ||
| final ProcedureExecutor<MasterProcedureEnv> pExecutor = master.getMasterProcedureExecutor(); | ||
| ServerCrashProcedure proc = new ServerCrashProcedure( | ||
| pExecutor.getEnvironment(), hostname123, false, false); | ||
|
|
||
| ProcedureTestingUtility.submitAndWait(pExecutor, proc); | ||
|
|
||
| assertFalse(master.getServerManager().getDeadServers().areDeadServersInProgress()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case should assert false, because the SCP has been done completely.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| assertTrue(master.getServerManager().areDeadServersInProgress()); | ||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -163,17 +152,14 @@ public void testClearDeadServer(){ | |
| d.putIfAbsent(hostname1234); | ||
| Assert.assertEquals(2, d.size()); | ||
|
|
||
| d.finish(hostname123); | ||
| d.removeDeadServer(hostname123); | ||
| Assert.assertEquals(1, d.size()); | ||
| d.finish(hostname1234); | ||
| d.removeDeadServer(hostname1234); | ||
| Assert.assertTrue(d.isEmpty()); | ||
|
|
||
| d.putIfAbsent(hostname1234); | ||
| Assert.assertFalse(d.removeDeadServer(hostname123_2)); | ||
| Assert.assertEquals(1, d.size()); | ||
| d.finish(hostname1234); | ||
| Assert.assertTrue(d.removeDeadServer(hostname1234)); | ||
| Assert.assertTrue(d.isEmpty()); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These codes are not only set the server be dead, but also set it be processing.
But the changed codes only set it be dead.
As a result ,when calling
ServerManager.expireServer()method, the server is firstly set be dead bymoveFromOnlineToDeadServers(), but the SCP is submitted afterwards.So this patch made a diff from the origin codes when calling
ServerManager.areDeadServersInProgress(), because the new codes has a little delay time of submit and execute the SCP procedure.