Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-10069

Potential duplicate calls to log#appendNoSync() in HRegion#doMiniBatchMutation()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.98.0, 0.99.0
    • Component/s: None
    • Labels:
      None

      Description

      In HRegion#doMiniBatchMutation():

              if (nonceGroup != currentNonceGroup || nonce != currentNonce) {
                if (walEdit.size() > 0) {
                  assert isInReplay;
                  txid = this.log.appendNoSync(this.getRegionInfo(), htableDescriptor.getTableName(),
                        walEdit, m.getClusterIds(), now, htableDescriptor, this.sequenceId, true,
                        currentNonceGroup, currentNonce);
                  hasWalAppends = true;
                }
                currentNonceGroup = nonceGroup;
                currentNonce = nonce;
              }
      
              // Add WAL edits by CP
              WALEdit fromCP = batchOp.walEditsFromCoprocessors[i];
              if (fromCP != null) {
                for (KeyValue kv : fromCP.getKeyValues()) {
                  walEdit.add(kv);
                }
              }
      ...
            Mutation mutation = batchOp.getMutation(firstIndex);
            if (walEdit.size() > 0) {
              txid = this.log.appendNoSync(this.getRegionInfo(), this.htableDescriptor.getTableName(),
                    walEdit, mutation.getClusterIds(), now, this.htableDescriptor, this.sequenceId,
                    true, currentNonceGroup, currentNonce);
              hasWalAppends = true;
            }
      

      If fromCP is null, there may not be new edits added to walEdit.
      But log#appendNoSync() would be called one more time at line 2368.

        Attachments

        1. HBASE-10069.patch
          2 kB
          Sergey Shelukhin

          Issue Links

            Activity

              People

              • Assignee:
                sershe Sergey Shelukhin
                Reporter:
                yuzhihong@gmail.com Ted Yu
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: