ctubbsii commented on a change in pull request #541: fixes #538 fix WAL
recovery code
URL: https://github.com/apache/accumulo/pull/541#discussion_r197554300
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
##########
@@ -190,38 +189,29 @@ private long findLastStartToFinish(List<Path>
recoveryLogs, Set<String> tabletFi
lastStart = key.seq;
lastStartFile = key.filename;
} else if (key.event == COMPACTION_FINISH) {
- if (lastEvent == null) {
- firstEventWasFinish = true;
- } else if (lastEvent == COMPACTION_FINISH) {
- throw new IllegalStateException(
- "Saw consecutive COMPACTION_FINISH events " + key.tabletId + "
" + key.seq);
- } else {
- if (key.seq <= lastStart) {
- throw new IllegalStateException(
- "Compaction finish <= start " + lastStart + " " + key.seq);
- }
- recoverySeq = lastStart;
- lastStartFile = null;
- sawStartFinish = true;
- }
+ checkState(key.seq >= lastFinish); // should only fail if bug
elsewhere
Review comment:
There is a similar check in the `COMPACTION_START` case. I think both of
those can be simplified to just check that this sequence number is `>=` the
last sequence number, regardless of what the last event type was (in other
words, it can be done before the if statement; also, that if statement to check
for `COMPACTION_START` or `COMPACTION_FINISH` could be a switch statement
instead).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services