From 924729d29d31c28ada92bb421a498661089eaeaf Mon Sep 17 00:00:00 2001 From: twthorn Date: Fri, 29 Sep 2023 16:35:23 -0700 Subject: [PATCH] Set durability policy of keyspaces --- src/test/docker/local/env.sh | 1 + src/test/docker/local/scripts/vttablet-up.sh | 2 ++ src/test/java/io/debezium/connector/vitess/TestHelper.java | 2 +- .../java/io/debezium/connector/vitess/VtctldConnection.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/docker/local/env.sh b/src/test/docker/local/env.sh index bad63bde..072b25af 100644 --- a/src/test/docker/local/env.sh +++ b/src/test/docker/local/env.sh @@ -45,6 +45,7 @@ mkdir -p "${VTDATAROOT}/tmp" alias mysql="command mysql -h 127.0.0.1 -P 15306" alias vtctlclient="command vtctlclient --server localhost:15999 --log_dir ${VTDATAROOT}/tmp --alsologtostderr" +alias vtctldclient="command vtctldclient --server localhost:15999 --log_dir ${VTDATAROOT}/tmp --alsologtostderr" # Make sure aliases are expanded in non-interactive shell shopt -s expand_aliases diff --git a/src/test/docker/local/scripts/vttablet-up.sh b/src/test/docker/local/scripts/vttablet-up.sh index 0862106e..eb868d2a 100755 --- a/src/test/docker/local/scripts/vttablet-up.sh +++ b/src/test/docker/local/scripts/vttablet-up.sh @@ -56,6 +56,8 @@ vttablet \ --vtctld_addr http://$hostname:$vtctld_web_port/ \ > $VTDATAROOT/$tablet_dir/vttablet.out 2>&1 & +vtctldclient --grpc_auth_static_client_creds grpc_static_client_auth.json SetKeyspaceDurabilityPolicy --durability-policy=semi_sync $keyspace + # Block waiting for the tablet to be listening # Not the same as healthy diff --git a/src/test/java/io/debezium/connector/vitess/TestHelper.java b/src/test/java/io/debezium/connector/vitess/TestHelper.java index 1e8f558a..999f4d8c 100644 --- a/src/test/java/io/debezium/connector/vitess/TestHelper.java +++ b/src/test/java/io/debezium/connector/vitess/TestHelper.java @@ -246,7 +246,7 @@ private static String readStringFromFile(String ddlFile) throws IOException, URI } public static int waitTimeForRecords() { - return Integer.parseInt(System.getProperty(TEST_PROPERTY_PREFIX + "records.waittime", "80")); + return Integer.parseInt(System.getProperty(TEST_PROPERTY_PREFIX + "records.waittime", "60")); } public static Binlogdata.VEvent defaultFieldEvent() { diff --git a/src/test/java/io/debezium/connector/vitess/VtctldConnection.java b/src/test/java/io/debezium/connector/vitess/VtctldConnection.java index 8a3e1559..6efd40a4 100644 --- a/src/test/java/io/debezium/connector/vitess/VtctldConnection.java +++ b/src/test/java/io/debezium/connector/vitess/VtctldConnection.java @@ -109,6 +109,7 @@ protected boolean checkOnlineDdlCompleted(String keyspace, String id) { List args = Arrays.asList("OnlineDDL", keyspace, "show", id); List results = execVtctl(args, vtctldHost, vtctldPort); AtomicBoolean isCompleted = new AtomicBoolean(false); + LOGGER.info("Results: {}", results); results.forEach(s -> { if (s.trim().equals("complete")) { isCompleted.set(true);