-
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-24822 Add a command to support archive the earliest log file ma… #2202
base: master
Are you sure you want to change the base?
Conversation
🎊 +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. |
The remained checkstyle issue is unrelated to this PR. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
* @param serverName The servername of the regionserver. | ||
* @throws IOException if a remote or network exception occurs | ||
*/ | ||
void archiveWAL(ServerName serverName) throws IOException; |
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.
Should method name reflect that the earliest log is archived ?
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.
Good point, will fix later.
Thanks.
.build(); | ||
|
||
/** | ||
* Create a new ArchiveWALRequest |
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.
No new request is created.
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.
Will fix later.
Thanks.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
rebase |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
The failure seems unrelated to this PR. |
PTAL if you have time. Thanks. @tedyu |
@@ -219,6 +219,12 @@ message RollWALWriterResponse { | |||
repeated bytes region_to_flush = 1; | |||
} | |||
|
|||
message ArchiveWALRequest { |
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.
Should this be renamed to go with the updated method name ?
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.
Will fix later. Thanks.
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.
Thought again, it should be a common name if we want to improve it in future, such as archive a specify log file, archive all log files, etc.
WDYT? Thanks.
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.
If it make sense, i will remove the "earliest" from method name also.
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.
I think ArchiveWALResponse should contain the status of archival (including error).
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.
I think ArchiveWALResponse should contain the status of archival (including error).
Make sense.
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.
Checked the existing api in Admin.java, such as flushRegion, compactRegion, seems currently we dont use status, if there is something wrong at server side, we notice client by throw ServiceException.
Though the FlushRegionResponse has a flushed flag, but does not be used at client.
Maybe we should keep consistent?
Thanks for comment. @tedyu
} | ||
// move the log file to archive dir | ||
this.totalLogSize.addAndGet(-firstWALEntry.getValue().logSize); | ||
moveLogFileToArchiveDir(firstWALEntry.getKey()); |
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.
What if IOException is thrown from this call ?
Would totalLogSize be correct ?
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.
Good point, the move action should be called first.
BTW, this part copied from existing code, maybe need a follow-on jira to fix it too.
Thanks.
if (r == null) { | ||
LOG.warn("Failed to flush of {} when archive manually, because it is not online on us", | ||
encodedRegionName); | ||
return; |
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.
It seems the return value should not be void - otherwise the caller wouldn't know this scenario (region not found).
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.
What do you think of just continue, since the region is not online(maybe closed or moved), anyway we will not lost data.
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.
When region close, the onRegionClose of SequenceIdAccounting should be called, so its regions will consist with onlineRegions in HRegionServer, if not, there must be something wrong, then the onlineRegions shall prevail.
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.
Or throw an Exception to notice client?
🎊 +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. |
Ping. @tedyu |
I am a bit busy recently. Please find another committer to review. Thanks |
Ok, thanks all the same for the comments. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…nually