Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,9 @@ public static void main(String[] args) throws Exception {
case UPDATE_ADMIN_OPERATION_PROTOCOL_VERSION:
updateAdminOperationProtocolVersion(cmd);
break;
case ROLL_FORWARD_TO_FUTURE_VERSION:
rollForwardToFutureVersion(cmd);
break;
default:
StringJoiner availableCommands = new StringJoiner(", ");
for (Command c: Command.values()) {
Expand Down Expand Up @@ -2535,6 +2538,30 @@ private static void sendEndOfPush(CommandLine cmd) {
printObject(response);
}

private static void rollForwardToFutureVersion(CommandLine cmd) {
String storeName = getRequiredArgument(cmd, Arg.STORE);
String regionsFilter = getOptionalArgument(cmd, Arg.REGIONS_FILTER);
String rollForwardTimeoutMs = getOptionalArgument(cmd, Arg.ROLL_FORWARD_TIMEOUT_MS);

ControllerResponse response;
if (regionsFilter == null) {
regionsFilter = "";
}
int timeoutMs;
if (rollForwardTimeoutMs != null) {
try {
timeoutMs = Integer.parseInt(rollForwardTimeoutMs);
response = controllerClient.rollForwardToFutureVersion(storeName, regionsFilter, timeoutMs);
} catch (NumberFormatException e) {
System.err.println("ERROR: " + rollForwardTimeoutMs + " is not a valid integer");
return;
}
} else {
response = controllerClient.rollForwardToFutureVersion(storeName, regionsFilter);
}
printObject(response);
}

/* Things that are not commands */

private static void printUsageAndExit(OptionGroup commandGroup, Options options, CommandLine cmd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ public enum Arg {
STORE_LIFECYCLE_HOOKS_LIST("store-lifecycle-hooks-list", "slhl", true, "List of store lifecycle hooks"),
KEY_URN_COMPRESSION_EANBLED(
"key-urn-compression-enabled", "kuce", true, "Enable/Disable key urn compression for a store."
), KEY_URN_FIELDS("key-urn-fields", "kuf", true, "Comma separated list of key urn fields.");
), KEY_URN_FIELDS("key-urn-fields", "kuf", true, "Comma separated list of key urn fields."),
ROLL_FORWARD_TIMEOUT_MS(
"roll-forward-timeout-ms", "rftm", true,
"Timeout in milliseconds for rolling forward to the new version during target colo push"
);

private final String argName;
private final String first;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
import static com.linkedin.venice.Arg.REPLICATION_FACTOR;
import static com.linkedin.venice.Arg.RETRY;
import static com.linkedin.venice.Arg.RMD_CHUNKING_ENABLED;
import static com.linkedin.venice.Arg.ROLL_FORWARD_TIMEOUT_MS;
import static com.linkedin.venice.Arg.SEPARATE_REALTIME_TOPIC_ENABLED;
import static com.linkedin.venice.Arg.SERVER_KAFKA_FETCH_QUOTA_RECORDS_PER_SECOND;
import static com.linkedin.venice.Arg.SERVER_URL;
Expand Down Expand Up @@ -640,6 +641,10 @@ public enum Command {
CLEAN_EXECUTION_IDS(
"clean-execution-ids", "Clean execution ids for the deleted store from `succeededPerStore` map.",
new Arg[] { URL, CLUSTER }
),
ROLL_FORWARD_TO_FUTURE_VERSION(
"roll-forward-to-future-version", "Roll forward to a future version", new Arg[] { URL, STORE },
new Arg[] { REGIONS_FILTER, ROLL_FORWARD_TIMEOUT_MS }
);

private final String commandName;
Expand Down
Loading