You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ne...@apache.org on 2018/12/07 23:59:47 UTC
[incubator-pinot] branch stop_validation_if_stop created (now
60b49d1)
This is an automated email from the ASF dual-hosted git repository.
nehapawar pushed a change to branch stop_validation_if_stop
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.
at 60b49d1 Add stop method in PinotLLCRealtimeSegmentManager
This branch includes the following new commits:
new 60b49d1 Add stop method in PinotLLCRealtimeSegmentManager
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[incubator-pinot] 01/01: Add stop method in
PinotLLCRealtimeSegmentManager
Posted by ne...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nehapawar pushed a commit to branch stop_validation_if_stop
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
commit 60b49d14d9c1b78ab921a3e5aaed1fdcccf1d460
Author: Neha Pawar <np...@linkedin.com>
AuthorDate: Fri Dec 7 15:58:22 2018 -0800
Add stop method in PinotLLCRealtimeSegmentManager
---
.../com/linkedin/pinot/controller/ControllerStarter.java | 3 +++
.../helix/core/realtime/PinotLLCRealtimeSegmentManager.java | 13 +++++++++++++
2 files changed, 16 insertions(+)
diff --git a/pinot-controller/src/main/java/com/linkedin/pinot/controller/ControllerStarter.java b/pinot-controller/src/main/java/com/linkedin/pinot/controller/ControllerStarter.java
index bf25cef..213a08f 100644
--- a/pinot-controller/src/main/java/com/linkedin/pinot/controller/ControllerStarter.java
+++ b/pinot-controller/src/main/java/com/linkedin/pinot/controller/ControllerStarter.java
@@ -293,6 +293,9 @@ public class ControllerStarter {
LOGGER.info("Stopping Jersey admin API");
_adminApp.stop();
+ LOGGER.info("Stopping PinotLLCRealtimeSegmentManager");
+ PinotLLCRealtimeSegmentManager.getInstance().stop();
+
LOGGER.info("Stopping realtime segment manager");
_realtimeSegmentsManager.stop();
diff --git a/pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java b/pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java
index b1ff634..e239834 100644
--- a/pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java
+++ b/pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java
@@ -111,6 +111,7 @@ public class PinotLLCRealtimeSegmentManager {
* The segment will be eligible for repairs by the validation manager, if the time exceeds this value
*/
private static int MAX_SEGMENT_COMPLETION_TIME_MINS = 10;
+ private static int WAIT_FOR_COMMIT_SEGMENT_METADATA_SECONDS = 30;
private static PinotLLCRealtimeSegmentManager INSTANCE = null;
@@ -128,6 +129,8 @@ public class PinotLLCRealtimeSegmentManager {
private final StreamPartitionAssignmentGenerator _streamPartitionAssignmentGenerator;
private final FlushThresholdUpdateManager _flushThresholdUpdateManager;
+ private volatile boolean _stop = false;
+
public boolean getIsSplitCommitEnabled() {
return _controllerConf.getAcceptSplitCommit();
}
@@ -159,6 +162,11 @@ public class PinotLLCRealtimeSegmentManager {
_helixManager.addControllerListener(changeContext -> onBecomeLeader());
}
+ public void stop() {
+ _stop = true;
+ Uninterruptibles.sleepUninterruptibly(WAIT_FOR_COMMIT_SEGMENT_METADATA_SECONDS, TimeUnit.SECONDS);
+ }
+
protected PinotLLCRealtimeSegmentManager(HelixAdmin helixAdmin, String clusterName, HelixManager helixManager,
ZkHelixPropertyStore propertyStore, PinotHelixResourceManager helixResourceManager, ControllerConf controllerConf,
ControllerMetrics controllerMetrics) {
@@ -395,6 +403,11 @@ public class PinotLLCRealtimeSegmentManager {
* @return boolean
*/
public boolean commitSegmentMetadata(String rawTableName, CommittingSegmentDescriptor committingSegmentDescriptor) {
+ // Do not allow segment metadata updates to proceed if controller is stopping
+ if (_stop) {
+ return false;
+ }
+
final String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(rawTableName);
TableConfig tableConfig = getRealtimeTableConfig(realtimeTableName);
if (tableConfig == null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org