-
Notifications
You must be signed in to change notification settings - Fork 26
MDBF-814 for install/upgrade save logs on failure #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
grooverdan
wants to merge
9
commits into
MariaDB:dev
Choose a base branch
from
grooverdan:MDBF-814-save-cs-logs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
516c3ad
master-libvirt: saveArtifactsStep for deb/rpm upgrade
grooverdan 4ced66e
bash_lib: change get_columnstore-logs to save_failure_logs
grooverdan 36ef633
bash_lib: do not change set +-e during check_mariadb_server_and_{crea…
grooverdan 638214d
deb: add trap for save_failure logs when we start to process
grooverdan 0ee9034
bash_lib: remove explict call to (remove) get_columnstore_logs
grooverdan 5d44ada
deb-install: remove duplicate columnstore error routine
grooverdan 87ac989
deb-upgrade: replace explicit columnstore save logs
grooverdan 03821e3
rpm-upgrade: add trap for error handling
grooverdan 59f9a2f
rpm-install: use save_failure_logs trap
grooverdan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -437,27 +437,37 @@ upgrade_test_type() { | |
| esac | ||
| } | ||
|
|
||
| get_columnstore_logs() { | ||
| save_failure_logs() { | ||
| local logdir=../logs/ | ||
| local logfile=$logdir/$test_mode.log | ||
| mkdir -p $logdir | ||
| bb_log_err "Previous step failed, saving mariadb logs" | ||
| if [[ $test_mode == "columnstore" ]]; then | ||
| bb_log_info "storing Columnstore logs in columnstore_logs" | ||
| set +ex | ||
| # It is done in such a weird way, because Columnstore currently makes its logs hard to read | ||
| # //TEMP this is fragile and weird (test that /var/log/mariadb/columnstore exist) | ||
| for f in $(sudo ls /var/log/mariadb/columnstore | xargs); do | ||
| f=/var/log/mariadb/columnstore/$f | ||
| echo "----------- $f -----------" >>/home/buildbot/columnstore_logs | ||
| sudo cat "$f" 1>>/home/buildbot/columnstore_logs 2>&1 | ||
| for f in $(sudo find /tmp/columnstore_tmp_files /var/log/mariadb/columnstore -type f); do | ||
| echo "----------- $f -----------" >>"$logfile" | ||
| sudo cat "$f" 1>>"$logfile" 2>&1 | ||
| done | ||
| for f in /tmp/columnstore_tmp_files/*; do | ||
| echo "----------- $f -----------" >>/home/buildbot/columnstore_logs | ||
| sudo cat "$f" | sudo tee -a /home/buildbot/columnstore_logs 2>&1 | ||
| for s in mcs-writeengineserver mcs-controllernode.service mcs-ddlproc.service mcs-dmlproc.service \ | ||
| mcs-loadbrm.service mcs-primproc.service [email protected]; do | ||
| echo "----------- $s -----------" >>"$logfile" | ||
| sudo journalctl -u "$s" | tee -a "$logfile" 2>&1 | ||
| done | ||
| if [ -d /var/lib/columnstore ]; then | ||
| tar -Jcvf $logdir/columnstore.tar.bz2 /var/lib/columnstore | ||
| fi | ||
| fi | ||
| echo "----------- mariadb.service -----------" >>"$logfile" | ||
| sudo journalctl -u mariadb.service | tee -a "$logfile" 2>&1 | ||
| if [ -f "$logfile" ]; then | ||
| bzip2 "$logfile" | ||
| fi | ||
| sudo find /var/lib/systemd/coredump/ -type -f -exec mv {} $logdir \; | ||
| } | ||
|
|
||
| check_mariadb_server_and_create_structures() { | ||
| # All the commands below should succeed | ||
| set -e | ||
| sudo mariadb -e "CREATE DATABASE db" | ||
| sudo mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'foo'),(2,'bar')" | ||
| sudo mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'foo'),(2,'bar')" | ||
|
|
@@ -468,19 +478,14 @@ check_mariadb_server_and_create_structures() { | |
| sudo mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge" | ||
| sudo mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1" | ||
| if [[ $test_mode == "columnstore" ]]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A failure here is handled in the parent script i.e. deb/rpm - upgrade? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, set -e/+e in this function incorrect. |
||
| if ! sudo mariadb -e "CREATE TABLE db.t_columnstore(a INT, c VARCHAR(8)) ENGINE=ColumnStore; SHOW CREATE TABLE db.t_columnstore; INSERT INTO db.t_columnstore VALUES (1,'foo'),(2,'bar')"; then | ||
| get_columnstore_logs | ||
| exit 1 | ||
| fi | ||
| sudo mariadb -e "CREATE TABLE db.t_columnstore(a INT, c VARCHAR(8)) ENGINE=ColumnStore; SHOW CREATE TABLE db.t_columnstore; INSERT INTO db.t_columnstore VALUES (1,'foo'),(2,'bar')" | ||
| fi | ||
| set +e | ||
| } | ||
|
|
||
| check_mariadb_server_and_verify_structures() { | ||
| # Print "have_xx" capabilitites for the new server | ||
| sudo mariadb -e "select 'Stat' t, variable_name name, variable_value val from information_schema.global_status where variable_name like '%have%' union select 'Vars' t, variable_name name, variable_value val from information_schema.global_variables where variable_name like '%have%' order by t, name" | ||
| # All the commands below should succeed | ||
| set -e | ||
| sudo mariadb -e "select @@version, @@version_comment" | ||
| sudo mariadb -e "SHOW TABLES IN db" | ||
| sudo mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'foo'),(4,'bar')" | ||
|
|
@@ -495,12 +500,8 @@ check_mariadb_server_and_verify_structures() { | |
| sudo mariadb -e "SELECT db.f()" | ||
|
|
||
| if [[ $test_mode == "columnstore" ]]; then | ||
| if ! sudo mariadb -e "SELECT * FROM db.t_columnstore; INSERT INTO db.t_columnstore VALUES (3,'foo'),(4,'bar')"; then | ||
| get_columnstore_logs | ||
| exit 1 | ||
| fi | ||
| sudo mariadb -e "SELECT * FROM db.t_columnstore; INSERT INTO db.t_columnstore VALUES (3,'foo'),(4,'bar')" | ||
| fi | ||
| set +e | ||
| } | ||
|
|
||
| control_mariadb_server() { | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.