deepthi912 commented on code in PR #17503:
URL: https://github.com/apache/pinot/pull/17503#discussion_r2922531563
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/ConcurrentMapPartitionUpsertMetadataManager.java:
##########
@@ -192,8 +213,62 @@ protected void removeSegment(IndexSegment segment,
Iterator<PrimaryKey> primaryK
_primaryKeyToRecordLocationMap.computeIfPresent(HashUtils.hashPrimaryKey(primaryKey,
_hashFunction),
(pk, recordLocation) -> {
if (recordLocation.getSegment() == segment) {
+ if (_context.isTableTypeInconsistentDuringConsumption() &&
segment instanceof MutableSegment) {
+ _previousKeyToRecordLocationMap.remove(pk);
+ }
+ return null;
+ }
+ return recordLocation;
+ });
+ }
+ }
+
+ @Override
+ protected void revertAndRemoveSegment(IndexSegment segment,
+ Iterator<Map.Entry<Integer, PrimaryKey>> primaryKeyIterator) {
+ while (primaryKeyIterator.hasNext()) {
+ Map.Entry<Integer, PrimaryKey> primaryKeyEntry =
primaryKeyIterator.next();
+ PrimaryKey primaryKey = primaryKeyEntry.getValue();
+ int docId = primaryKeyEntry.getKey();
+
_primaryKeyToRecordLocationMap.computeIfPresent(HashUtils.hashPrimaryKey(primaryKey,
_hashFunction),
+ (pk, recordLocation) -> {
+ RecordLocation prevLocation =
_previousKeyToRecordLocationMap.get(primaryKey);
+ if (prevLocation == null) {
+ _previousKeyToRecordLocationMap.remove(primaryKey);
return null;
Review Comment:
Valid suggestion
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]