anoopsjohn commented on a change in pull request #3318: URL: https://github.com/apache/hbase/pull/3318#discussion_r644466713
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/Compactor.java ########## @@ -451,25 +451,26 @@ protected boolean performCompaction(FileDetails fd, InternalScanner scanner, Cel progress.cancel(); return false; } - if (kvs != null && bytesWrittenProgressForShippedCall > shippedCallSizeLimit) { - if (lastCleanCell != null) { - // HBASE-16931, set back sequence id to avoid affecting scan order unexpectedly. - // ShipperListener will do a clone of the last cells it refer, so need to set back - // sequence id before ShipperListener.beforeShipped - PrivateCellUtil.setSequenceId(lastCleanCell, lastCleanCellSeqId); - } - // Clone the cells that are in the writer so that they are freed of references, - // if they are holding any. - ((ShipperListener) writer).beforeShipped(); - // The SHARED block references, being read for compaction, will be kept in prevBlocks - // list(See HFileScannerImpl#prevBlocks). In case of scan flow, after each set of cells - // being returned to client, we will call shipped() which can clear this list. Here by - // we are doing the similar thing. In between the compaction (after every N cells - // written with collective size of 'shippedCallSizeLimit') we will call shipped which - // may clear prevBlocks list. - kvs.shipped(); - bytesWrittenProgressForShippedCall = 0; + } + if (kvs != null && bytesWrittenProgressForShippedCall > shippedCallSizeLimit) { + if (lastCleanCell != null) { + // HBASE-16931, set back sequence id to avoid affecting scan order unexpectedly. + // ShipperListener will do a clone of the last cells it refer, so need to set back + // sequence id before ShipperListener.beforeShipped + PrivateCellUtil.setSequenceId(lastCleanCell, lastCleanCellSeqId); + lastCleanCell = null; Review comment: yes. Before calling shipped (which will release BBs) we are setting back the seqId. The beforeShipped call make sure that other layers which hold cell ref will copy those cells. Now after reset the seqId, we make lastCleanCell = null. So no chance of calling again setSequenceId on same Cell. If u have a repro, will u be able to check pls? -- 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: us...@infra.apache.org