Bug 229618 - [PATCH] databases/mariadb102-server, wsrep_sst_mariabackup cannot run on FreeBSD
Summary: [PATCH] databases/mariadb102-server, wsrep_sst_mariabackup cannot run on FreeBSD
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bernard Spil
Depends on:
Reported: 2018-07-09 00:16 UTC by TAO ZHOU
Modified: 2019-08-15 05:41 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (brnrd)

patch-scripts_wsrep__sst_mariabackup.sh.diff (3.27 KB, patch)
2018-07-09 00:16 UTC, TAO ZHOU
no flags Details | Diff
POSIX-ify wsrep_sst_mariabackup.sh (26.26 KB, patch)
2018-07-13 14:40 UTC, Bernard Spil
no flags Details | Diff
POSIX-ify wsrep_sst_mariabackup.sh (28.78 KB, patch)
2018-07-13 14:53 UTC, Bernard Spil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TAO ZHOU 2018-07-09 00:16:42 UTC
Created attachment 194968 [details]

Attached is my patch to make wsrep_sst_mariabackup run on FreeBSD.
There are two main problems with the original one.
1. FreeBSD does not have 'ss' command
2. FreBSD 'find' command use a different syntax for regex
Comment 1 Bernard Spil freebsd_committer 2018-07-12 12:45:10 UTC
Hi Tao,

Are there any bashisms in that script?
Your patch would require adding runtime dependencies on both lsof and bash, which I'd rather not have.

I've submitted fixes to these scripts earlier. Can you please see if you can provide a similar fix as https://jira.mariadb.org/browse/MDEV-10432 ?
If you feel uncomfortable with upstreaming the fix, I can help when the patch is OK.

Cheers, Bernard.
Comment 2 TAO ZHOU 2018-07-13 00:51:40 UTC
I agree.
I don't like the dependencies either.
I would prefer sockstat to lsof. 


Also, mariadb is moving alway wsrep_sst_mariabackup. They've accepted some of my other commits and merged them to wsrep_sst_xtrabackup-v2.sh

From my testing, none of the wsrep* scripts worked without hacking the script.
Comment 3 Bernard Spil freebsd_committer 2018-07-13 09:27:06 UTC
Check `wsrep_sst_rsync.sh`
> #!/bin/sh -ue

which is no longer a bashism.
Comment 4 Bernard Spil freebsd_committer 2018-07-13 14:40:38 UTC
Created attachment 195112 [details]
POSIX-ify wsrep_sst_mariabackup.sh

Can you see if this works for you? Might be some rough edges...

Think the RC[0] and RC[@] need refactoring, sh does not have PIPELINESTATUS or arrays.
Comment 5 Bernard Spil freebsd_committer 2018-07-13 14:53:35 UTC
Created attachment 195113 [details]
POSIX-ify wsrep_sst_mariabackup.sh

Now includes a fix for the PIPELINESTATUS Array that will surely throw errors in POSIX sh.

Mind you, this just reports an error on fail, not the part of the pipeline where it failed!

Please test and let me know.
Comment 6 Bernard Spil freebsd_committer 2018-07-13 15:18:28 UTC
Dang! Didn't know we have `timeout` on FreeBSD...
Comment 7 TAO ZHOU 2019-08-15 05:41:33 UTC
This is fixed by https://github.com/MariaDB/server/pull/929