Skip to content

Commit 86057b9

Browse files
authored
[vpj][controller] Fix minor bugs in validation flow for DeferredVersionSwapService (linkedin#2133)
- Use the version config's target region as the target region to validate for validation flow - Use getControllerClientMap() as this will use d2 map and url map - Add check for if all child regions are online then mark parent as online to stop vpj polling to account for roll forward controller client timeouts - Refactor DeferredVersionSwapService to separate out sequential roll forward logic and parallel roll forward logic - Add vpj config to modify wait time
1 parent b8eec29 commit 86057b9

11 files changed

Lines changed: 594 additions & 342 deletions

File tree

clients/venice-push-job/src/main/java/com/linkedin/venice/hadoop/PushJobSetting.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public class PushJobSetting implements Serializable {
7878
public String targetedRegions;
7979
public boolean isTargetedRegionPushEnabled;
8080
public boolean isTargetRegionPushWithDeferredSwapEnabled;
81+
public int targetRegionPushWithDeferredSwapWaitTime;
8182
public boolean isSystemSchemaReaderEnabled;
8283
public boolean isZstdDictCreationRequired;
8384
public boolean isZstdDictCreationSuccess;

clients/venice-push-job/src/main/java/com/linkedin/venice/hadoop/VenicePushJob.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_ENABLED;
7575
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_LIST;
7676
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP;
77+
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP_WAIT_TIME_MINUTES;
7778
import static com.linkedin.venice.vpj.VenicePushJobConstants.TEMP_DIR_PREFIX;
7879
import static com.linkedin.venice.vpj.VenicePushJobConstants.UNCREATED_VERSION_NUMBER;
7980
import static com.linkedin.venice.vpj.VenicePushJobConstants.VALUE_FIELD_PROP;
@@ -96,6 +97,7 @@
9697
import com.linkedin.venice.controllerapi.RepushInfoResponse;
9798
import com.linkedin.venice.controllerapi.SchemaResponse;
9899
import com.linkedin.venice.controllerapi.StoreResponse;
100+
import com.linkedin.venice.controllerapi.UpdateStoreQueryParams;
99101
import com.linkedin.venice.controllerapi.VersionCreationResponse;
100102
import com.linkedin.venice.d2.D2ClientFactory;
101103
import com.linkedin.venice.etl.ETLValueSchemaTransformation;
@@ -431,6 +433,9 @@ private PushJobSetting getPushJobSetting(VeniceProperties props) {
431433
+ " at the same time");
432434
}
433435

436+
pushJobSettingToReturn.targetRegionPushWithDeferredSwapWaitTime =
437+
props.getInt(TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP_WAIT_TIME_MINUTES, -1);
438+
434439
if (props.containsKey(TARGETED_REGION_PUSH_LIST)) {
435440
if (pushJobSettingToReturn.isTargetedRegionPushEnabled
436441
|| pushJobSettingToReturn.isTargetRegionPushWithDeferredSwapEnabled) {
@@ -686,6 +691,13 @@ public void run() {
686691
initKIFRepushDetails();
687692
}
688693

694+
if (pushJobSetting.targetRegionPushWithDeferredSwapWaitTime > -1) {
695+
controllerClient.updateStore(
696+
pushJobSetting.storeName,
697+
new UpdateStoreQueryParams()
698+
.setTargetRegionSwapWaitTime(pushJobSetting.targetRegionPushWithDeferredSwapWaitTime));
699+
}
700+
689701
setupJobTimeoutMonitor();
690702
initPushJobDetails();
691703
logGreeting();

clients/venice-push-job/src/main/java/com/linkedin/venice/vpj/VenicePushJobConstants.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ private VenicePushJobConstants() {
393393
*/
394394
public static final String TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP = "targeted.region.push.with.deferred.swap";
395395

396+
/**
397+
* Config to update the wait time in minutes for target region push with deferred version swap
398+
*/
399+
public static final String TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP_WAIT_TIME_MINUTES =
400+
"targeted.region.push.with.deferred.swap.wait.time.minutes";
401+
396402
public static final boolean DEFAULT_IS_DUPLICATED_KEY_ALLOWED = false;
397403

398404
/**

internal/venice-test-common/src/integrationTest/java/com/linkedin/venice/endToEnd/TestDeferredVersionSwap.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import static com.linkedin.venice.utils.TestWriteUtils.getTempDataDirectory;
1111
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_LIST;
1212
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP;
13+
import static com.linkedin.venice.vpj.VenicePushJobConstants.TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP_WAIT_TIME_MINUTES;
1314
import static org.testng.Assert.assertEquals;
1415
import static org.testng.Assert.assertFalse;
1516
import static org.testng.Assert.assertNotNull;
@@ -142,7 +143,6 @@ public void testDeferredVersionSwap(String targetRegions) throws IOException {
142143
IntegrationTestPushUtils.defaultVPJProps(multiRegionMultiClusterWrapper, inputDirPath, storeName);
143144
String keySchemaStr = "\"string\"";
144145
UpdateStoreQueryParams storeParms = new UpdateStoreQueryParams().setUnusedSchemaDeletionEnabled(true);
145-
storeParms.setTargetRegionSwapWaitTime(1);
146146
String parentControllerURLs = multiRegionMultiClusterWrapper.getControllerConnectString();
147147

148148
try (ControllerClient parentControllerClient = new ControllerClient(CLUSTER_NAMES[0], parentControllerURLs)) {
@@ -151,6 +151,7 @@ public void testDeferredVersionSwap(String targetRegions) throws IOException {
151151
// Start push job with target region push enabled
152152
props.put(TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP, true);
153153
props.put(TARGETED_REGION_PUSH_LIST, targetRegions);
154+
props.put(TARGETED_REGION_PUSH_WITH_DEFERRED_SWAP_WAIT_TIME_MINUTES, 1);
154155
IntegrationTestPushUtils.runVPJ(props);
155156
TestUtils.waitForNonDeterministicPushCompletion(
156157
Version.composeKafkaTopic(storeName, 1),

0 commit comments

Comments
 (0)