Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4029

improve the log of FileTxnLog#append method

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: server

      Description

      We found the following logs that it's very confusing

      2020-12-16 15:19:09,202 [myid:5] - WARN  [SyncThread:5:FileTxnLog@275] - Current zxid 858993459201 is <= 858993459203 for -10
      2020-12-16 15:19:09,202 [myid:5] - WARN  [SyncThread:5:FileTxnLog@275] - Current zxid 858993459202 is <= 858993459203 for -10
      2020-12-16 15:19:09,203 [myid:5] - WARN  [SyncThread:5:FileTxnLog@275] - Current zxid 858993459203 is <= 858993459203 for 5
      

      The potential improvement may be:

      if (hdr.getZxid() <= lastZxidSeen) {
          LOG.warn(
              "Current zxid {} is <= {} for operation {}",
              hdr.getZxid(),
              lastZxidSeen,
              Request.op2String(hdr.getType()));
      } else {
          lastZxidSeen = hdr.getZxid();
      }
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                maoling Ling Mao
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m