FLUME-1527. Seed TransactionID/WriteOrderID in the case no logs need to be 
replayed.

(Brock Noland via Hari Shreedharan)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/0f526703
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/0f526703
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/0f526703

Branch: refs/heads/cdh-1.2.0+24_intuit
Commit: 0f526703b8873b2a16f42380a1a5f11b28746381
Parents: cf44ac0
Author: Hari Shreedharan <[email protected]>
Authored: Thu Aug 30 14:48:58 2012 -0700
Committer: Mike Percy <[email protected]>
Committed: Fri Sep 7 14:03:06 2012 -0700

----------------------------------------------------------------------
 .../apache/flume/channel/file/ReplayHandler.java   |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/0f526703/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/ReplayHandler.java
----------------------------------------------------------------------
diff --git 
a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/ReplayHandler.java
 
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/ReplayHandler.java
index 14e2ff7..6f8af09 100644
--- 
a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/ReplayHandler.java
+++ 
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/ReplayHandler.java
@@ -212,7 +212,8 @@ class ReplayHandler {
   void replayLog(List<File> logs) throws IOException {
     int count = 0;
     MultiMap transactionMap = new MultiValueMap();
-    long transactionIDSeed = 0, writeOrderIDSeed = 0;
+    // seed both with the highest known sequence of either the tnxid or woid
+    long transactionIDSeed = lastCheckpoint, writeOrderIDSeed = lastCheckpoint;
     LOG.info("Starting replay of " + logs);
     //Load the inflight puts into the transaction map to see if they were
     //committed in one of the logs.

Reply via email to