klsince commented on code in PR #11020:
URL: https://github.com/apache/pinot/pull/11020#discussion_r1253587772
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BaseTableUpsertMetadataManager.java:
##########
@@ -75,6 +115,145 @@ public void init(TableConfig tableConfig, Schema schema,
TableDataManager tableD
_enableSnapshot = upsertConfig.isEnableSnapshot();
_serverMetrics = serverMetrics;
+ _helixManager = helixManager;
+ _preloadExecutor = preloadExecutor;
+ try {
+ if (_enableSnapshot && upsertConfig.isEnablePreload()) {
+ preloadSegments();
Review Comment:
In fact, the `createTableDataManager()` method pasted above creates the
TableDataManager object first, and then calls its init() method. The preloading
logic happens as part of the init() method. So among the Helix threads about to
handle segment state transitions, only the first Helix thread would proceed and
preload segments, and the other Helix threads would wait for it to finish, as
ensured by ConcurrentHashMap.computeIfAbsent(... lambda), which runs the lambda
atomically
--
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]