-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Morgan Douglas <mdouglas47@bloomberg.net>
- Loading branch information
Showing
6 changed files
with
73 additions
and
1 deletion.
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,9 @@ | ||
ifeq ($(TESTSROOTDIR),) | ||
include ../testcase.mk | ||
else | ||
include $(TESTSROOTDIR)/testcase.mk | ||
endif | ||
ifeq ($(TEST_TIMEOUT),) | ||
export TEST_TIMEOUT=1m | ||
endif | ||
unexport CLUSTER |
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 @@ | ||
setattr min_keep_logs 0 | ||
setattr min_keep_logs_age 0 | ||
setattr logdeleteage 0 | ||
setattr debug_log_deletion 1 | ||
test_logdel_with_low_headroom 1 |
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,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
DBNAME=$1 | ||
tier="default" | ||
|
||
push_logs_to_second_logfile() { | ||
cdb2sql ${CDB2_OPTIONS} $DBNAME $tier "exec procedure sys.cmd.send('pushnext')" | ||
for (( i=0; i<3; ++i )); | ||
do | ||
cdb2sql ${CDB2_OPTIONS} $DBNAME $tier "exec procedure sys.cmd.send('flush')" | ||
sleep 1 | ||
done | ||
} | ||
|
||
get_num_archivable_logs() { | ||
cdb2sql ${CDB2_OPTIONS} $DBNAME $tier "exec procedure sys.cmd.send('bdb log_archive')" | wc -l | ||
} | ||
|
||
delete_first_logfile() { | ||
# first delete command should result in node updating its local low file number. | ||
# second delete command should result in the actual deletion. | ||
|
||
cdb2sql ${CDB2_OPTIONS} $DBNAME $tier "exec procedure sys.cmd.send('deletelogs')" | ||
cdb2sql ${CDB2_OPTIONS} $DBNAME $tier "exec procedure sys.cmd.send('deletelogs')" | ||
} | ||
|
||
main() { | ||
push_logs_to_second_logfile | ||
|
||
local num_archivable_logs | ||
num_archivable_logs=$(get_num_archivable_logs) | ||
if (( num_archivable_logs != 1 )); | ||
then | ||
echo "ERROR: Expected to have an archivable log after pushing to next logfile" | ||
return 1 | ||
fi | ||
|
||
delete_first_logfile | ||
|
||
num_archivable_logs=$(get_num_archivable_logs) | ||
if (( num_archivable_logs != 0 )); | ||
then | ||
echo "ERROR: Expected to have no archivable logs after log deletion" | ||
return 1 | ||
fi | ||
|
||
return 0 | ||
} | ||
|
||
main | ||
|