lokeshj1703 opened a new pull request #1828:
URL: https://github.com/apache/ozone/pull/1828
## What changes were proposed in this pull request?
If SCM cleans up all the DeletedBlocksTransaction in deletedBlocksTable,
then restart, the txID in SCMMetadataStoreImpl will drop to 0.
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);
...
}```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4477
## How was this patch tested?
Existing UT - TestDeletedBlockLog and other deletion tests
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]