You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/08/20 02:23:46 UTC

[GitHub] [incubator-iotdb] neuyilan commented on pull request #1635: [Distributed] fix async applier bug when do snapshpot

neuyilan commented on pull request #1635:
URL: https://github.com/apache/incubator-iotdb/pull/1635#issuecomment-676856963


   > The fix itself has a potential problem that when new logs keep coming in, it is very likely to time out.
   > Now I see you want to make sure when the snapshot is taken, all previous logs are applied. This side effect has been noticed but back to then, AsyncApplier is merely in the experimental stage. Since you have fixed one of the problems, I would like to give some pieces of advice to make AsyncApplier complete:
   > 
   > 1. When starting to take a snapshot, record the current commitIndex.
   > 2. Block until all logs whose indices <= the recorded commitIndex are applied. (Use RaftLogManager to do so instead of LogApplier)
   > 3. Prevent the log cleaner thread to clean logs that are not applied.
   > 4. Change `StorageEngine.getInstance().syncCloseAllProcessor();` in `takeSnapshot()` to send a flush plan within the group. (So the file sequence will not be broken by snapshots)
   > 5. When committed logs are recovered during start-up, re-apply all of them. (Notice that operation sequences in IoTDB are idempotent)
   
   Great suggestion, I think the 1-3 items you mentioned is to make sure that when do snapshot, new logs can not be added and the snapshot task should not take long time.  however now the implementation can block the new logs coming in, as when do snapshot we should get the _logManager_ lock, so new logs can not be committed(commited log also  need to get the  _logManager_ lock ), we just need to wait all the previous committed log applied when do snapshot.
   
   I'm going to rethink the 4-5 suggestions.
   
   
   
   
   
    
   


----------------------------------------------------------------
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