You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/03/15 21:16:30 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #6682: Fix bug #6671: RealtimeTableDataManager shuts down SegmentBuildTimeLeaseExtender for all tables in the host

jackjlli commented on a change in pull request #6682:
URL: https://github.com/apache/incubator-pinot/pull/6682#discussion_r594688627



##########
File path: pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManagerTest.java
##########
@@ -765,6 +768,20 @@ public void testOnlyOneSegmentHoldingTheSemaphoreForParticularPartition()
     Assert.assertEquals(secondSegmentDataManager.get().getPartitionGroupConsumerSemaphore().availablePermits(), 1);
   }
 
+  @Test
+  public void testDifferentSegmentBuildTimeLeaseExtenderDestroyedForTables()

Review comment:
       What's the meaning of this test name? What/How to destroy? Can you add some comments to the test?

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/SegmentBuildTimeLeaseExtender.java
##########
@@ -46,25 +46,25 @@
   // Retransmit lease request 10% before lease expires.
   private static final int REPEAT_REQUEST_PERIOD_SEC = (EXTRA_TIME_SECONDS * 9 / 10);
   private static Logger LOGGER = LoggerFactory.getLogger(SegmentBuildTimeLeaseExtender.class);
-  private static final Map<String, SegmentBuildTimeLeaseExtender> INSTANCE_TO_LEASE_EXTENDER = new HashMap<>(1);
+  private static final Map<String, SegmentBuildTimeLeaseExtender> TABLE_TO_LEASE_EXTENDER = new HashMap<>(1);
 
   private ScheduledExecutorService _executor;
   private final Map<String, Future> _segmentToFutureMap = new ConcurrentHashMap<>();
   private final String _instanceId;
   private final ServerSegmentCompletionProtocolHandler _protocolHandler;
 
-  public static SegmentBuildTimeLeaseExtender getLeaseExtender(final String instanceId) {
-    return INSTANCE_TO_LEASE_EXTENDER.get(instanceId);
+  public static SegmentBuildTimeLeaseExtender getLeaseExtender(final String tableNameWithType) {
+    return TABLE_TO_LEASE_EXTENDER.get(tableNameWithType);
   }
 
   public static synchronized SegmentBuildTimeLeaseExtender create(final String instanceId,
       ServerMetrics serverMetrics, String tableNameWithType) {
-    SegmentBuildTimeLeaseExtender leaseExtender = INSTANCE_TO_LEASE_EXTENDER.get(instanceId);
+    SegmentBuildTimeLeaseExtender leaseExtender = TABLE_TO_LEASE_EXTENDER.get(tableNameWithType);
     if (leaseExtender != null) {
-      LOGGER.warn("Instance already exists");
+      LOGGER.warn("Lease extender for {} already exists", tableNameWithType);

Review comment:
       `Lease extender for Table:  {} already exists`.




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

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