You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/09/09 11:11:47 UTC

[GitHub] [zookeeper] maoling commented on pull request #1744: ZOOKEEPER-4362: ZKDatabase.txnCount should not log non transactional requests

maoling commented on pull request #1744:
URL: https://github.com/apache/zookeeper/pull/1744#issuecomment-915991022


   - @lanicc  Great catch.
   - Oops, it may be not an improvement, just a hidden bug which was introduced by [PR-770](https://github.com/apache/zookeeper/pull/770)
   The refactor is not an equivalence.
   ```
    // track the number of records written to the log
     if (zks.getZKDatabase().append(si)) {
         logCount++;
         if (logCount > randRoll) {
             randRoll = ThreadLocalRandom.current().nextInt(snapCount / 2, snapCount);
             // roll the log
   ```
   
   - A worse case: when I do 100000 read requests and then do a write request. In this pattern with a read-heavy use case, too many many snapshots are taken, even the `DataTree` are not changed(if the write request is `closeSession`)
   - PTAL @ztzg  @eolivelli 


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

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org