jchen21 commented on pull request #5689: URL: https://github.com/apache/geode/pull/5689#issuecomment-731472883
When compacting oplogs offline, it creates a new krf and persists `totalCount` with `0` in Oplog constructor. Then live entries are copied from old oplogs to the new oplog. `totalCount` of the new oplog is updated during this process. However, the updated `totalCount` is not persisted. Its persisted value is still `0`, although the oplog is non-empty after compaction. During recovery, the value of `totalCount` is recovered from krf as `0`. `totalLiveCount` is incremented as the oplog is recovered. `totalCount` remains `0`. Therefore, if `totalCount` == 0 and `totalLiveCount` > 0, no compaction is needed. Since this condition shows that offline compaction is just done before recovery. ---------------------------------------------------------------- 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: [email protected]
