zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] sonymoon commented on a change in pull request #982: ZOOKEEPER-1621: Delete and skip txn log with incomplete header
Date Thu, 27 Jun 2019 03:47:28 GMT
sonymoon commented on a change in pull request #982: ZOOKEEPER-1621: Delete and skip txn log
with incomplete header
URL: https://github.com/apache/zookeeper/pull/982#discussion_r297971115
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/FileTxnLog.java
 ##########
 @@ -690,10 +691,30 @@ public long getStorageSize() {
          * @throws IOException
          */
         private boolean goToNextLog() throws IOException {
-            if (storedFiles.size() > 0) {
+            while (storedFiles.size() > 0) {
                 this.logFile = storedFiles.remove(storedFiles.size()-1);
-                ia = createInputArchive(this.logFile);
-                return true;
+                try {
+                    ia = createInputArchive(this.logFile);
+                    return true;
+                } catch (StreamCorruptedException ex) {
+                    // The magic number is corrupted. We shouldn't simply skip
+                    // this log file since it might contain transactions that
+                    // have already been acknowledged.
+                    throw ex;
+                } catch (EOFException ex) {
 
 Review comment:
   txnlog file may not just lose dbid field, but also serval txn bytes blocks. The rest of
txn byte blocks are still complete and acknowledged to clients

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Mime
View raw message