xiangfu0 commented on code in PR #20187:
URL: https://github.com/apache/pinot/pull/20187#discussion_r4699854135


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2053,7 +2081,10 @@ public void addTable(TableConfig tableConfig, 
List<StreamMetadata> streamMetadat
 
     // Add table config
     LOGGER.info("Adding table {}: Creating table config in the property 
store", tableNameWithType);
-    if (!ZKMetadataProvider.createTableConfig(_propertyStore, tableConfig)) {
+    if (requireRawNameAbsent) {
+      createFirstTableConfig(getOrBuildMultiWriteZkClient(), 
PropertyPathBuilder.propertyStore(_helixClusterName),
+          tableConfig);

Review Comment:
   This is still open at 06e6c5f56f, and it is wider now: every `addTable` 
publishes through the dedicated client and then reads the config back through 
`_propertyStore` on the Helix session. `checkSchemaExists` and 
`SchemaPublicationFence.acquire` add the same dependency in the other 
direction, because they look up a schema that the same request may have just 
written through the Helix session.
   
   I should correct my estimate, though. I measured it with a local 
three-server ensemble (ZooKeeper 3.9.7, loopback) and one raw client session 
pinned to each server, creating a znode on one session and calling `exists` on 
another:
   
   - Idle ensemble: no stale reads in more than 15,000 tries, whichever servers 
the two sessions were on.
   - Another session writing 512 KB znodes continuously, roughly what large 
IdealState updates look like: 28 of 5,000 reads were stale. With one more small 
write on the writing session before the read, which is what the receipt delete 
happens to do in this commit, it was 0 of 3,000.
   - Reader's server behind a backlog (paused while a few large writes and the 
target write committed on the other two, with the read already queued): 260 of 
260 stale.
   
   So a quiet, healthy cluster won't see this, and "now and then" was too 
strong. It shows up when the Helix session's server is catching up. Then the 
read-back returns null, the `checkState` throws, and `addTable` deletes the 
table it just published. Since this path now serves every table create I'd 
still close it, either by reading back through the client that ran the multi or 
by running the multi on the Helix session.



-- 
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]

Reply via email to