You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "abhishekbafna (via GitHub)" <gi...@apache.org> on 2025/05/21 09:40:39 UTC

[PR] Handle remove build routing for logical tables. [pinot]

abhishekbafna opened a new pull request, #15862:
URL: https://github.com/apache/pinot/pull/15862

   * Added a new getTimeBoundaryTableNames method to time boundary strategy.
   * Handle remove routing when table state move from ONLINE -> {OFFLINE, DROPPED}.
   * Updated the `/routing/{tableName}` API for build and remove routing for logical tables.
   
   Closes: #15835 


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "vrajat (via GitHub)" <gi...@apache.org>.
vrajat commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2107035759


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/logicaltable/LogicalTableWithTwoOfflineOneRealtimeTableIntegrationTest.java:
##########
@@ -62,15 +64,17 @@ public void testUpdateLogicalTableTimeBoundary()
 
   private void updateTimeBoundaryTableInLogicalTable(LogicalTableConfig logicalTableConfig)
       throws IOException {
-    List<String> includedTables =
-        (List<String>) logicalTableConfig.getTimeBoundaryConfig().getParameters().get("includedTables");
+    TimeBoundaryStrategy timeBoundaryStrategy = TimeBoundaryStrategyService.getInstance()
+        .getTimeBoundaryStrategy(logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy());
+    List<String> includedTables = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
 
     String timeBoundaryTableName = TableNameBuilder.extractRawTableName(includedTables.get(0));
     String newTimeBoundaryTableName = timeBoundaryTableName.equals("o_1") ? "o_2" : "o_1";
     newTimeBoundaryTableName = TableNameBuilder.OFFLINE.tableNameWithType(newTimeBoundaryTableName);
 
     Map<String, Object> parameters = Map.of("includedTables", List.of(newTimeBoundaryTableName));
     logicalTableConfig.getTimeBoundaryConfig().setParameters(parameters);
+    logicalTableConfig.setQueryConfig(null);

Review Comment:
   Curious - why was this required ? Did a previous test not clean up ? 



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/timeboundary/TimeBoundaryStrategy.java:
##########
@@ -43,4 +44,12 @@ public interface TimeBoundaryStrategy {
    */
   TimeBoundaryInfo computeTimeBoundary(LogicalTableConfig logicalTableConfig, TableCache tableCache,
       RoutingManager routingManager);
+
+
+  /**
+   * Returns the list of physical table names that are part of the time boundary.
+   * @param logicalTableConfig The logical table configuration
+   * @return The list of physical table names that are part of the time boundary.
+   */
+  List<String> getTimeBoundaryTableNames(LogicalTableConfig logicalTableConfig);

Review Comment:
   The only other startegy that we know of is `ConstantValueStrategy`. For that even `cleanup` is not required. Another option is to execute all tasks through the `RoutingManager` interface. Pass the routing manager to a `cleanup`. 
   
   However, on 2nd thought. This is OK for now. The list of tables maybe useful in another functions as well. 



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -653,6 +656,44 @@ public synchronized void removeRouting(String tableNameWithType) {
     }
   }
 
+  public synchronized void removeRoutingForLogicalTable(String logicalTableName) {
+    LOGGER.info("Removing time boundary manager for logical table: {}", logicalTableName);
+    LogicalTableConfig logicalTableConfig =
+        ZKMetadataProvider.getLogicalTableConfig(_propertyStore, logicalTableName);
+    Preconditions.checkState(logicalTableConfig != null, "Failed to find logical table config for: %s",
+        logicalTableName);
+    if (!logicalTableConfig.isHybridLogicalTable()) {
+      LOGGER.info("Skip removing time boundary manager for non hybrid logical table: {}", logicalTableName);
+      return;
+    }
+    String strategy = logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy();
+    TimeBoundaryStrategy timeBoundaryStrategy =
+        TimeBoundaryStrategyService.getInstance().getTimeBoundaryStrategy(strategy);
+    List<String> timeBoundaryTableNames = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
+    for (String tableNameWithType : timeBoundaryTableNames) {
+
+      if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {

Review Comment:
   This cannot be true ? A time boundary cannot be associated with a realtime table. 



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "abhishekbafna (via GitHub)" <gi...@apache.org>.
abhishekbafna commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2104371118


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/timeboundary/TimeBoundaryStrategy.java:
##########
@@ -43,4 +44,12 @@ public interface TimeBoundaryStrategy {
    */
   TimeBoundaryInfo computeTimeBoundary(LogicalTableConfig logicalTableConfig, TableCache tableCache,
       RoutingManager routingManager);
+
+
+  /**
+   * Returns the list of physical table names that are part of the time boundary.
+   * @param logicalTableConfig The logical table configuration
+   * @return The list of physical table names that are part of the time boundary.
+   */
+  List<String> getTimeBoundaryTableNames(LogicalTableConfig logicalTableConfig);

Review Comment:
   My thinking, time boundary will be determined based on a set of [offline] tables though calculation could be min, max or something else.
   
   I think, `_routingEntryMap` should not be passed to other classes and its management should remain with in `BrokerRoutingManager`. Also, each strategy need to implement the `cleanup` method and why it would be different for different strategy.
   
   The time boundary specific tables will be required to build and remove routing, why it should be done in strategy?



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "abhishekbafna (via GitHub)" <gi...@apache.org>.
abhishekbafna commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2107366459


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/logicaltable/LogicalTableWithTwoOfflineOneRealtimeTableIntegrationTest.java:
##########
@@ -62,15 +64,17 @@ public void testUpdateLogicalTableTimeBoundary()
 
   private void updateTimeBoundaryTableInLogicalTable(LogicalTableConfig logicalTableConfig)
       throws IOException {
-    List<String> includedTables =
-        (List<String>) logicalTableConfig.getTimeBoundaryConfig().getParameters().get("includedTables");
+    TimeBoundaryStrategy timeBoundaryStrategy = TimeBoundaryStrategyService.getInstance()
+        .getTimeBoundaryStrategy(logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy());
+    List<String> includedTables = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
 
     String timeBoundaryTableName = TableNameBuilder.extractRawTableName(includedTables.get(0));
     String newTimeBoundaryTableName = timeBoundaryTableName.equals("o_1") ? "o_2" : "o_1";
     newTimeBoundaryTableName = TableNameBuilder.OFFLINE.tableNameWithType(newTimeBoundaryTableName);
 
     Map<String, Object> parameters = Map.of("includedTables", List.of(newTimeBoundaryTableName));
     logicalTableConfig.getTimeBoundaryConfig().setParameters(parameters);
+    logicalTableConfig.setQueryConfig(null);

Review Comment:
   Locally, the timeout test runs first and fails which leaves 1ms query timeout and sometime cause failure for this test. This test run a lot query and randomly it fails for one of them.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "vrajat (via GitHub)" <gi...@apache.org>.
vrajat commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2102876342


##########
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BrokerResourceOnlineOfflineStateModelFactory.java:
##########
@@ -97,14 +97,19 @@ public void onBecomeOnlineFromOffline(Message message, NotificationContext conte
 
     @Transition(from = "ONLINE", to = "OFFLINE")
     public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
-      String tableNameWithType = message.getPartitionName();
-      LOGGER.info("Processing transition from ONLINE to OFFLINE for table: {}", tableNameWithType);
+      String physicalOrLogicalTable = message.getPartitionName();

Review Comment:
   Why is this method called for logical table ? Is it because an entry is removed from `brokerResource` ?



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/timeboundary/TimeBoundaryStrategy.java:
##########
@@ -43,4 +44,12 @@ public interface TimeBoundaryStrategy {
    */
   TimeBoundaryInfo computeTimeBoundary(LogicalTableConfig logicalTableConfig, TableCache tableCache,
       RoutingManager routingManager);
+
+
+  /**
+   * Returns the list of physical table names that are part of the time boundary.
+   * @param logicalTableConfig The logical table configuration
+   * @return The list of physical table names that are part of the time boundary.
+   */
+  List<String> getTimeBoundaryTableNames(LogicalTableConfig logicalTableConfig);

Review Comment:
   This is specific to `MinTimeBoundaryStrategy`. Other strategies may not need it. Is a `cleanup(RouteEntryMap)` a better interface method ? 



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -653,6 +656,44 @@ public synchronized void removeRouting(String tableNameWithType) {
     }
   }
 
+  public synchronized void removeRoutingForLogicalTable(String logicalTableName) {
+    LOGGER.info("Removing time boundary manager for logical table: {}", logicalTableName);
+    LogicalTableConfig logicalTableConfig =
+        ZKMetadataProvider.getLogicalTableConfig(_propertyStore, logicalTableName);
+    Preconditions.checkState(logicalTableConfig != null, "Failed to find logical table config for: %s",
+        logicalTableName);
+    if (!logicalTableConfig.isHybridLogicalTable()) {
+      LOGGER.info("Skip removing time boundary manager for non hybrid logical table: {}", logicalTableName);
+      return;
+    }
+    String strategy = logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy();
+    TimeBoundaryStrategy timeBoundaryStrategy =
+        TimeBoundaryStrategyService.getInstance().getTimeBoundaryStrategy(strategy);
+    List<String> timeBoundaryTableNames = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
+    for (String tableNameWithType : timeBoundaryTableNames) {
+
+      if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {
+        LOGGER.warn("Skipping removing time boundary manager for real-time table: {}", tableNameWithType);

Review Comment:
   This is should be an INFO. 



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -653,6 +656,44 @@ public synchronized void removeRouting(String tableNameWithType) {
     }
   }
 
+  public synchronized void removeRoutingForLogicalTable(String logicalTableName) {
+    LOGGER.info("Removing time boundary manager for logical table: {}", logicalTableName);
+    LogicalTableConfig logicalTableConfig =
+        ZKMetadataProvider.getLogicalTableConfig(_propertyStore, logicalTableName);
+    Preconditions.checkState(logicalTableConfig != null, "Failed to find logical table config for: %s",
+        logicalTableName);
+    if (!logicalTableConfig.isHybridLogicalTable()) {
+      LOGGER.info("Skip removing time boundary manager for non hybrid logical table: {}", logicalTableName);
+      return;
+    }
+    String strategy = logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy();
+    TimeBoundaryStrategy timeBoundaryStrategy =
+        TimeBoundaryStrategyService.getInstance().getTimeBoundaryStrategy(strategy);
+    List<String> timeBoundaryTableNames = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
+    for (String tableNameWithType : timeBoundaryTableNames) {
+
+      if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {
+        LOGGER.warn("Skipping removing time boundary manager for real-time table: {}", tableNameWithType);
+        continue;
+      }
+
+      String rawTableName = TableNameBuilder.extractRawTableName(tableNameWithType);
+      String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(rawTableName);
+      if (_routingEntryMap.containsKey(realtimeTableName)) {
+        LOGGER.warn("Skipping removing time boundary manager for hybrid physical table: {}", rawTableName);

Review Comment:
   Same here. It is OK for it to be a hybrid table



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15862:
URL: https://github.com/apache/pinot/pull/15862#issuecomment-2897433109

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/15862?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `0%` with `2 lines` in your changes missing coverage. Please review.
   > Project coverage is 56.34%. Comparing base [(`1a476de`)](https://app.codecov.io/gh/apache/pinot/commit/1a476dea72ebf1c15e14ded28ae60c385f71b2c3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`505684b`)](https://app.codecov.io/gh/apache/pinot/commit/505684b793bf6400ea502c94fe6da6e195da420d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 113 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/15862?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ot/query/timeboundary/MinTimeBoundaryStrategy.java](https://app.codecov.io/gh/apache/pinot/pull/15862?src=pr&el=tree&filepath=pinot-query-planner%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Ftimeboundary%2FMinTimeBoundaryStrategy.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvdGltZWJvdW5kYXJ5L01pblRpbWVCb3VuZGFyeVN0cmF0ZWd5LmphdmE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/15862?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   > :exclamation:  There is a different number of reports uploaded between BASE (1a476de) and HEAD (505684b). Click for more details.
   > 
   > <details><summary>HEAD has 68 uploads less than BASE</summary>
   >
   >| Flag | BASE (1a476de) | HEAD (505684b) |
   >|------|------|------|
   >|java-21|10|1|
   >|unittests|6|1|
   >|unittests1|3|1|
   >|skip-bytebuffers-true|4|0|
   >|temurin|15|1|
   >|unittests2|3|0|
   >|skip-bytebuffers-false|8|0|
   >|java-11|5|0|
   >|integration|9|0|
   >|integration2|3|0|
   >|integration1|3|0|
   >|custom-integration1|3|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #15862      +/-   ##
   ============================================
   - Coverage     62.90%   56.34%   -6.57%     
   + Complexity     1386      690     -696     
   ============================================
     Files          2867     2276     -591     
     Lines        163354   123828   -39526     
     Branches      24952    19749    -5203     
   ============================================
   - Hits         102755    69768   -32987     
   + Misses        52847    48297    -4550     
   + Partials       7752     5763    -1989     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <0.00%> (-6.48%)` | :arrow_down: |
   | [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <0.00%> (-6.57%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <0.00%> (-6.56%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <0.00%> (+0.52%)` | :arrow_up: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/15862/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/15862?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "abhishekbafna (via GitHub)" <gi...@apache.org>.
abhishekbafna commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2104353813


##########
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BrokerResourceOnlineOfflineStateModelFactory.java:
##########
@@ -97,14 +97,19 @@ public void onBecomeOnlineFromOffline(Message message, NotificationContext conte
 
     @Transition(from = "ONLINE", to = "OFFLINE")
     public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
-      String tableNameWithType = message.getPartitionName();
-      LOGGER.info("Processing transition from ONLINE to OFFLINE for table: {}", tableNameWithType);
+      String physicalOrLogicalTable = message.getPartitionName();

Review Comment:
   Yes.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "abhishekbafna (via GitHub)" <gi...@apache.org>.
abhishekbafna commented on code in PR #15862:
URL: https://github.com/apache/pinot/pull/15862#discussion_r2107358228


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -653,6 +656,44 @@ public synchronized void removeRouting(String tableNameWithType) {
     }
   }
 
+  public synchronized void removeRoutingForLogicalTable(String logicalTableName) {
+    LOGGER.info("Removing time boundary manager for logical table: {}", logicalTableName);
+    LogicalTableConfig logicalTableConfig =
+        ZKMetadataProvider.getLogicalTableConfig(_propertyStore, logicalTableName);
+    Preconditions.checkState(logicalTableConfig != null, "Failed to find logical table config for: %s",
+        logicalTableName);
+    if (!logicalTableConfig.isHybridLogicalTable()) {
+      LOGGER.info("Skip removing time boundary manager for non hybrid logical table: {}", logicalTableName);
+      return;
+    }
+    String strategy = logicalTableConfig.getTimeBoundaryConfig().getBoundaryStrategy();
+    TimeBoundaryStrategy timeBoundaryStrategy =
+        TimeBoundaryStrategyService.getInstance().getTimeBoundaryStrategy(strategy);
+    List<String> timeBoundaryTableNames = timeBoundaryStrategy.getTimeBoundaryTableNames(logicalTableConfig);
+    for (String tableNameWithType : timeBoundaryTableNames) {
+
+      if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {

Review Comment:
   It can be true given we do not have validation for it at the moment. Even in the build routing we have added a check that time boundary table names should be offline tables. Similarly, this check is to skip them.
   
   In case of th build we choose to raise exception but in the clean up it should continue and do the cleanup for the rest.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Handle remove build routing for logical tables. [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #15862:
URL: https://github.com/apache/pinot/pull/15862


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org