-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-28260: Add NO_WRITE_LOCAL flag to WAL file creation #5733
HBASE-28260: Add NO_WRITE_LOCAL flag to WAL file creation #5733
Conversation
🎊 +1 overall
This message was automatically generated. |
dfsBuilder.replicate(); | ||
} | ||
dfsBuilder.noLocalWrite(); |
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.
shouldn't this be like the following?
dfsBuilder.replicate(); | |
} | |
dfsBuilder.noLocalWrite(); | |
dfsBuilder.noLocalWrite(); | |
} | |
dfsBuilder.replicate(); |
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.
Yes, my bad
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
By default we use AsyncProtobufLogWriter, so we also need to change the code there. |
DistributedFileSystem.HdfsDataOutputStreamBuilder dfsBuilder = | ||
(DistributedFileSystem.HdfsDataOutputStreamBuilder) builder; | ||
dfsBuilder.replicate(); | ||
if (fs.getConf().getBoolean("hbase.regionserver.wal.avoid-local-writes", false)) { |
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.
Better declare a String constants for this config.
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.
done
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Thanks for pointing this out, I've addressed it now |
@@ -180,8 +182,10 @@ public AsyncFSOutput getOutput() { | |||
protected void initOutput(FileSystem fs, Path path, boolean overwritable, int bufferSize, | |||
short replication, long blockSize, StreamSlowMonitor monitor) | |||
throws IOException, StreamLacksCapabilityException { | |||
boolean noLocalWrite = |
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.
Better add this as a parameter of the initOutput method? So we do not need to write the similar code twice in AsyncProtobufLogWriter and ProtobufLogWriter.
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.
done!
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
LGTM
@Apache9 any other comments here?
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
Having all three replicas of each WAL file blocks be non-local to the RegionServer makes it less likely that failures of a co-located RegionServer and DataNode result in a corrupt WAL file. See the JIRA ticket for more details about how this can happen. This new setting is off by default, and can be enabled with
hbase.regionserver.wal.avoid-local-writes
. I think off by default makes sense, because this can have performance implications.