-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-27230 RegionServer should be aborted when WAL.sync throws Timeo… #4641
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
7e536e9
HBASE-27230 RegionServer should be aborted when WAL.sync throws Timeo…
comnetwork 968297c
fix error
comnetwork 83c56f3
fix error
comnetwork b6e5ab9
fix serialId
comnetwork 499ff33
fix serialId
comnetwork 01b114c
fix serialId
comnetwork 1b8eee8
add comments
comnetwork bd7fc27
add comments
comnetwork e8ed08c
add comments
comnetwork 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
48 changes: 48 additions & 0 deletions
48
...ver/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALSyncTimeoutIOException.java
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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.regionserver.wal; | ||
|
|
||
| import org.apache.hadoop.hbase.HBaseIOException; | ||
| import org.apache.hadoop.hbase.wal.WAL; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| /** | ||
| * Thrown when {@link WAL#sync} timeout. | ||
| */ | ||
| @InterfaceAudience.Private | ||
| public class WALSyncTimeoutIOException extends HBaseIOException { | ||
|
|
||
| private static final long serialVersionUID = 5067699288291906985L; | ||
|
|
||
| public WALSyncTimeoutIOException() { | ||
| super(); | ||
| } | ||
|
|
||
| public WALSyncTimeoutIOException(String message, Throwable cause) { | ||
| super(message, cause); | ||
| } | ||
|
|
||
| public WALSyncTimeoutIOException(String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public WALSyncTimeoutIOException(Throwable cause) { | ||
| super(cause); | ||
| } | ||
|
|
||
| } |
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 |
|---|---|---|
|
|
@@ -62,9 +62,15 @@ void init(FileSystem fs, Path path, Configuration c, boolean overwritable, long | |
| StreamSlowMonitor monitor) throws IOException, CommonFSUtils.StreamLacksCapabilityException; | ||
| } | ||
|
|
||
| private EventLoopGroup eventLoopGroup; | ||
|
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. Add comments to say this will be used in tests.
Contributor
Author
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. @Apache9 ,ok ,fixed. |
||
| /** | ||
| * Protected visibility for used in tests. | ||
| */ | ||
| protected EventLoopGroup eventLoopGroup; | ||
|
|
||
| private Class<? extends Channel> channelClass; | ||
| /** | ||
| * Protected visibility for used in tests. | ||
| */ | ||
| protected Class<? extends Channel> channelClass; | ||
|
|
||
| @Override | ||
| protected AsyncFSWAL createWAL() throws IOException { | ||
|
|
||
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
Oops, something went wrong.
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.
Actually we should avoid aborting the RS when the WAL sync is slow or timeout. As in the design of HBASE-22301 we should try to roll slow WALs to connect and rewrite to faster DNs. If you want to recover the flushing of WALs by aborting the RS, you will suffer from a whole MTTR but only the new WAL created by the newly started RS is helpful to the question.
Uh oh!
There was an error while loading. Please reload this page.
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.
@sunhelly , thank you for review, yes , I could catch your point, here means after we does what you said, such as roll WALs and open a new writer and try to write the WAL entries again and again, and finally WAL.sync still timeout, we abort the RS. We set a very large default value here, 5 minutes, usually the WAL system will abort the region server if it can not finish the sync within 5 minutes, see HBASE-27233 and #4633 for more discussion.
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.
Got it, agree with the point 'no failure for WAL sync', whenever WAL.sync throws exception(no matter it is timeout or other), the regionserver should abort. This is a common logic.