-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{177357479}: Fixing an sc-resume corner case
The cluster may hang after the new master fails to resume a schema change. This patch fixes it. Signed-off-by: Rivers Zhang <[email protected]>
- Loading branch information
1 parent
caac905
commit 43e0ecc
Showing
6 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ifeq ($(TESTSROOTDIR),) | ||
include ../testcase.mk | ||
else | ||
include $(TESTSROOTDIR)/testcase.mk | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
setattr MEMPTRICKLEPERCENT 50 | ||
logmsg level info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# simple test to verify that new master does not block indefinitely when | ||
# resuming a schema change that made zero progress from the previous master | ||
|
||
source ${TESTSROOTDIR}/tools/runit_common.sh | ||
source ${TESTSROOTDIR}/tools/cluster_utils.sh | ||
|
||
bash -n "$0" | exit 1 | ||
[ -z "${CLUSTER}" ] && { echo "Test requires a cluster"; exit 0; } | ||
|
||
dbnm=$1 | ||
master=`cdb2sql --tabs ${CDB2_OPTIONS} $dbnm default 'SELECT host FROM comdb2_cluster WHERE is_master="Y"'` | ||
|
||
cdb2sql ${CDB2_OPTIONS} $dbnm default "CREATE TABLE t1 (a INTEGER)" | ||
cdb2sql ${CDB2_OPTIONS} $dbnm default "INSERT INTO t1 VALUES (1)" | ||
|
||
for node in $CLUSTER ; do | ||
cdb2sql $dbnm --host $node "EXEC PROCEDURE sys.cmd.send('on rep_delay')" | ||
done | ||
|
||
cdb2sql $dbnm --host $master "EXEC PROCEDURE sys.cmd.send('convert_record_sleep 1')" | ||
cdb2sql ${CDB2_OPTIONS} $dbnm default "REBUILD t1" & | ||
waitpid=$! | ||
sleep 2 # give the master node a bit time to get to the convert thread | ||
for node in $CLUSTER ; do | ||
kill_restart_node $node & | ||
done | ||
|
||
wait $waitpid | ||
sleep 5 | ||
cdb2sql ${CDB2_OPTIONS} $dbnm default "INSERT INTO t1 VALUES (1)" |