lokeshj1703 commented on a change in pull request #1828:
URL: https://github.com/apache/ozone/pull/1828#discussion_r561719236
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java
##########
@@ -312,19 +335,19 @@ public int getNumOfValidTransactions() throws IOException
{
public void addTransactions(Map<Long, List<Long>> containerBlocksMap)
throws IOException {
lock.lock();
- try {
- try(BatchOperation batch =
- scmMetadataStore.getStore().initBatchOperation()) {
- for (Map.Entry< Long, List< Long > > entry :
- containerBlocksMap.entrySet()) {
- long nextTXID = scmMetadataStore.getNextDeleteBlockTXID();
- DeletedBlocksTransaction tx = constructNewTransaction(nextTXID,
- entry.getKey(), entry.getValue());
- scmMetadataStore.getDeletedBlocksTXTable().putWithBatch(batch,
- nextTXID, tx);
- }
- scmMetadataStore.getStore().commitBatchOperation(batch);
+ try (BatchOperation batch = scmMetadataStore.getStore()
+ .initBatchOperation()) {
+ for (Map.Entry<Long, List<Long>> entry : containerBlocksMap.entrySet()) {
+ long nextTXID = getNextDeleteBlockTXID();
+ scmMetadataStore.getDeletedBlocksTXTable().putWithBatch(batch,
nextTXID,
+ constructNewTransaction(nextTXID, entry.getKey(),
+ entry.getValue()));
}
+ scmMetadataStore.getDeletedBlocksTXTable()
+ .putWithBatch(batch, largestTxnIdHolderKey,
+ DeletedBlocksTransaction.newBuilder().setTxID(getCurrentTXID())
+ .setContainerID(1).setCount(1).build());
Review comment:
Addressed in latest commit.
----------------------------------------------------------------
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]