This is an automated email from the ASF dual-hosted git repository.
kharekartik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 8cdae92502 [Upsert] Skip removing upsert metadata when shutting down
the server (#9551)
8cdae92502 is described below
commit 8cdae925020dc8ae32777d3e6205340d22bac7fd
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Fri Oct 7 03:12:53 2022 -0700
[Upsert] Skip removing upsert metadata when shutting down the server (#9551)
---
.../segment/local/upsert/BasePartitionUpsertMetadataManager.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
index 7bcb33cf19..1eb7684c30 100644
---
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
+++
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
@@ -61,6 +61,8 @@ public abstract class BasePartitionUpsertMetadataManager
implements PartitionUps
@VisibleForTesting
public final Set<IndexSegment> _replacedSegments =
ConcurrentHashMap.newKeySet();
+ protected volatile boolean _closed = false;
+
protected long _lastOutOfOrderEventReportTimeNs = Long.MIN_VALUE;
protected int _numOutOfOrderEvents = 0;
@@ -245,6 +247,11 @@ public abstract class BasePartitionUpsertMetadataManager
implements PartitionUps
((ImmutableSegmentImpl)
segment).persistValidDocIdsSnapshot(validDocIds);
}
+ if (_closed) {
+ _logger.info("Skip removing segment: {} because metadata manager is
already closed", segment);
+ return;
+ }
+
if (validDocIds == null || validDocIds.isEmpty()) {
_logger.info("Skip removing segment without valid docs: {}",
segmentName);
return;
@@ -281,5 +288,6 @@ public abstract class BasePartitionUpsertMetadataManager
implements PartitionUps
public void close()
throws IOException {
_logger.info("Closing the metadata manager, current primary key count:
{}", getNumPrimaryKeys());
+ _closed = true;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]