This is an automated email from the ASF dual-hosted git repository.
xiangfu0 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 5bf9e68b40e Refresh server table config cache on update (#18796)
5bf9e68b40e is described below
commit 5bf9e68b40e471e28809321f3b4c73830ce6be67
Author: Xiang Fu <[email protected]>
AuthorDate: Wed Jun 17 17:56:31 2026 -0700
Refresh server table config cache on update (#18796)
---
.../helix/core/PinotHelixResourceManager.java | 3 +-
.../PinotHelixResourceManagerStatelessTest.java | 37 ++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
index 35bc0cb301a..da30ef1cf4f 100644
---
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
+++
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
@@ -2659,8 +2659,9 @@ public class PinotHelixResourceManager {
// Assign instances
assignInstances(tableConfig, false);
- // Send update query quota message if quota is specified
+ // Refresh brokers and servers so in-memory table config caches observe
the update.
sendTableConfigRefreshMessage(tableNameWithType);
+ sendTableConfigSchemaRefreshMessage(tableNameWithType);
}
public void deleteUser(String username) {
diff --git
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerStatelessTest.java
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerStatelessTest.java
index cd70ff00e99..ae025c13903 100644
---
a/pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerStatelessTest.java
+++
b/pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerStatelessTest.java
@@ -66,6 +66,7 @@ import org.apache.pinot.core.common.MinionConstants;
import org.apache.pinot.core.realtime.impl.fakestream.FakeStreamConfigUtils;
import org.apache.pinot.spi.config.instance.Instance;
import org.apache.pinot.spi.config.instance.InstanceType;
+import org.apache.pinot.spi.config.table.QueryConfig;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.config.table.TableTaskConfig;
import org.apache.pinot.spi.config.table.TableType;
@@ -100,9 +101,11 @@ import org.testng.annotations.Test;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.*;
@@ -1051,6 +1054,40 @@ public class PinotHelixResourceManagerStatelessTest
extends ControllerTest {
assertTrue(tierToSegmentsMap.isEmpty());
}
+ @Test
+ public void testUpdateTableConfigRefreshesBrokerAndServerCaches()
+ throws Exception {
+ String rawTableName = "tableConfigRefreshTest";
+ String offlineTableName =
TableNameBuilder.OFFLINE.tableNameWithType(rawTableName);
+ addDummySchema(rawTableName);
+ TableConfig tableConfig = new
TableConfigBuilder(TableType.OFFLINE).setTableName(rawTableName)
+ .setBrokerTenant(BROKER_TENANT_NAME)
+ .setServerTenant(SERVER_TENANT_NAME)
+ .build();
+ waitForEVToDisappear(tableConfig.getTableName());
+ _helixResourceManager.addTable(tableConfig);
+
+ PinotHelixResourceManager resourceManager = spy(_helixResourceManager);
+
doNothing().when(resourceManager).sendTableConfigRefreshMessage(offlineTableName);
+
doNothing().when(resourceManager).sendTableConfigSchemaRefreshMessage(offlineTableName);
+
+ try {
+ TableConfig updatedTableConfig = new
TableConfigBuilder(TableType.OFFLINE).setTableName(rawTableName)
+ .setBrokerTenant(BROKER_TENANT_NAME)
+ .setServerTenant(SERVER_TENANT_NAME)
+ .setQueryConfig(new QueryConfig(10000L, null, null, null, null,
null))
+ .build();
+
+ resourceManager.updateTableConfig(updatedTableConfig);
+
+ verify(resourceManager).sendTableConfigRefreshMessage(offlineTableName);
+
verify(resourceManager).sendTableConfigSchemaRefreshMessage(offlineTableName);
+ } finally {
+ _helixResourceManager.deleteOfflineTable(rawTableName);
+ deleteSchema(rawTableName);
+ }
+ }
+
/**
* Tests the code path where a subset of merged segments (from the original
segmentsTo list)
* is passed to the endReplace API.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]