ctubbsii commented on a change in pull request #541: fixes #538 fix WAL recovery code
URL: https://github.com/apache/accumulo/pull/541#discussion_r197551733
##########
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
+ checkState(key.seq > lastStart, "Compaction finish <= start %s %s %s", key.tabletId,
+ key.seq, lastStart);
+ checkState(lastEvent == null || lastEvent == COMPACTION_START,
Review comment:
This would be more clear as `lastEvent != COMPACTION_FINISH`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
|