swaminathanmanish commented on code in PR #13735:
URL: https://github.com/apache/pinot/pull/13735#discussion_r1701086173
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3476,160 +3476,161 @@ public String startReplaceSegments(String
tableNameWithType, List<String> segmen
segment, tableNameWithType);
}
- try {
- DEFAULT_RETRY_POLICY.attempt(() -> {
- // Fetch table config
- TableConfig tableConfig =
ZKMetadataProvider.getTableConfig(_propertyStore, tableNameWithType);
- Preconditions.checkState(tableConfig != null, "Failed to find table
config for table: %s", tableNameWithType);
-
- // Fetch the segment lineage metadata
- ZNRecord segmentLineageZNRecord =
-
SegmentLineageAccessHelper.getSegmentLineageZNRecord(_propertyStore,
tableNameWithType);
- SegmentLineage segmentLineage;
- int expectedVersion;
- if (segmentLineageZNRecord == null) {
- segmentLineage = new SegmentLineage(tableNameWithType);
- expectedVersion = -1;
- } else {
- segmentLineage = SegmentLineage.fromZNRecord(segmentLineageZNRecord);
- expectedVersion = segmentLineageZNRecord.getVersion();
- }
- // Check that the segment lineage entry id doesn't exist in the
segment lineage
-
Preconditions.checkState(segmentLineage.getLineageEntry(segmentLineageEntryId)
== null,
- "Entry id: %s already exists in the segment lineage for table:
%s", segmentLineageEntryId,
- tableNameWithType);
+ synchronized (getTableUpdaterLock(tableNameWithType)) {
Review Comment:
This lock is also used for IS update which is different than lineage. IS and
lineage are different Znodes and their updates can block each other?
Could we use a dedicated lock/semaphore just for lineage ?
--
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]