vvivekiyer commented on a change in pull request #8110:
URL: https://github.com/apache/pinot/pull/8110#discussion_r798234709
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -1778,48 +1778,64 @@ public void addNewSegment(String tableNameWithType,
SegmentMetadata segmentMetad
public void addNewSegment(String tableNameWithType, SegmentMetadata
segmentMetadata, String downloadUrl,
@Nullable String crypter) {
- String segmentName = segmentMetadata.getName();
- InstancePartitionsType instancePartitionsType;
// NOTE: must first set the segment ZK metadata before assigning segment
to instances because segment assignment
// might need them to determine the partition of the segment, and server
will need them to download the segment
- ZNRecord znRecord;
+ SegmentZKMetadata segmentZkmetadata =
+ constructZkMetadataForNewSegment(tableNameWithType, segmentMetadata,
downloadUrl, crypter,
+ false);
+ ZNRecord znRecord = segmentZkmetadata.toZNRecord();
+
+ String segmentName = segmentMetadata.getName();
+ String segmentZKMetadataPath =
+
ZKMetadataProvider.constructPropertyStorePathForSegment(tableNameWithType,
segmentName);
+ Preconditions.checkState(_propertyStore.set(segmentZKMetadataPath,
znRecord, AccessOption.PERSISTENT),
+ "Failed to set segment ZK metadata for table: " + tableNameWithType +
", segment: " + segmentName);
+ LOGGER.info("Added segment: {} of table: {} to property store",
segmentName, tableNameWithType);
+
+ assignTableSegment(tableNameWithType, segmentName);
+ }
+
+ public SegmentZKMetadata constructZkMetadataForNewSegment(String
tableNameWithType, SegmentMetadata segmentMetadata,
Review comment:
Done.
--
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]