[ 
https://issues.apache.org/jira/browse/GEODE-8667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249430#comment-17249430
 ] 

ASF GitHub Bot commented on GEODE-8667:
---------------------------------------

jchen21 commented on pull request #5689:
URL: https://github.com/apache/geode/pull/5689#issuecomment-744970105


   @dschneider-pivotal So far, I still consider the current fix is the best 
option we can have. We need a convenient and reliable way to tell that the 
Oplog is offline compacted. The persisted `0` value of `totalCount` in krf 
serves the purpose. And during persistence recovery, if `totalCount` is `0`, 
then it is updated with the value of `totalLiveCount`, which is the most 
accurate value of the number of live entries in the Oplog.
   
   I have been thinking about whether we should use the local variable 
`krfEntryCount`, instead of `totalLiveCount`. At the end of `readKrf()`, the 
value of `totalLiveCount` and `krfEntryCount` are the same. Because at the 
beginning of `readKrf()`, `totalLiveCount` and `krfEntryCount` are both 0. And 
in the `while` loop inside `readKrf()`, both variables are incremented 
together: 
   
   `totalLiveCount` is incremented here: 
https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java#L1765
   
   `krfEntryCount` is incremented here: 
https://github.com/apache/geode/blob/develop/geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java#L1768
   
   I'd prefer using `totalLiveCount` instead of `krfEntryCount` which is a 
local variable.


----------------------------------------------------------------
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:
us...@infra.apache.org


> Duplicate online Oplog compaction after offline Oplog compaction
> ----------------------------------------------------------------
>
>                 Key: GEODE-8667
>                 URL: https://issues.apache.org/jira/browse/GEODE-8667
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Jianxia Chen
>            Assignee: Jianxia Chen
>            Priority: Major
>              Labels: GeodeOperationAPI, pull-request-available
>
> Use `compact offline-disk-store` command to compact the Oplogs offline. 
> Then restart the servers. 
> The logs show OplogCompactor thread is compacting Oplogs again when 
> restarting the servers, even though the Oplogs were just compacted offline. 
> For example:
> ```
> [info 2020/10/27 16:32:22.534 PDT <Idle OplogCompactor1> tid=0x35] Recovered 
> values for disk store DEFAULT with unique id 
> 76393d3c-dd10-4b89-b655-821d37631774
> [info 2020/10/27 16:32:22.535 PDT <OplogCompactor DEFAULT for oplog oplog#2> 
> tid=0x35] OplogCompactor for DEFAULT compaction oplog id(s): oplog#2
> [info 2020/10/27 16:32:22.537 PDT <OplogCompactor DEFAULT for oplog oplog#2> 
> tid=0x35] compaction did 2 creates and updates in 2 ms
> [info 2020/10/27 16:32:22.537 PDT <Oplog Delete Task1> tid=0x36] Deleted 
> oplog#2 crf for disk store DEFAULT.
> [info 2020/10/27 16:32:22.538 PDT <Oplog Delete Task1> tid=0x36] Deleted 
> oplog#2 krf for disk store DEFAULT.
> [info 2020/10/27 16:32:22.538 PDT <Oplog Delete Task1> tid=0x36] Deleted 
> oplog#2 drf for disk store DEFAULT.
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to