Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-4477

Delete txnId in SCMMetadataStoreImpl may drop to 0 after SCM restart.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.1.0
    • SCM

    Description

      Summary

      If SCM cleans up all the DeletedBlocksTransaction in deletedBlocksTable, then restart, the txID in SCMMetadataStoreImpl will drop to 0.

       

      Detail

      in SCMMetadataStoreImpl.java

      public SCMMetadataStoreImpl(OzoneConfiguration config)
          throws IOException {
        this.configuration = config;
        start(this.configuration);
        this.txID = new AtomicLong(this.getLargestRecordedTXID());
      }
      
      private Long getLargestRecordedTXID() throws IOException {
        try (TableIterator<Long, ? extends KeyValue<Long, DeletedBlocksTransaction>>
            txIter = deletedBlocksTable.iterator()) {
          txIter.seekToLast();
          Long txid = txIter.key();
          if (txid != null) {
            return txid;
          }
        }
        return 0L;
      }

       

      in DeletedBlockLogImpl.java

      public void commitTransactions(
          List<DeleteBlockTransactionResult> transactionResults, UUID dnID) {
        ...
        scmMetadataStore.getDeletedBlocksTXTable().delete(txID);
        ...
      }

      Attachments

        Issue Links

          Activity

            People

              ljain Lokesh Jain
              glengeng Glen Geng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: