<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/ctdb/tests/UNIT/shellcheck, branch talloc-2.4.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>ctdb-failover: Split statd_callout add-client/del-client</title>
<updated>2024-06-25T04:24:57+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2024-05-10T01:42:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=415f9f07456e3fd24063e7508d8b2553df020c21'/>
<id>415f9f07456e3fd24063e7508d8b2553df020c21</id>
<content type='text'>
rpc.statd is single-threaded and runs its HA callout synchronously. If
it is too slow then latency accumulates and rpc.statd's backlog grows.

Running a pair of add-client/del-client events with the current code
averages ~0.030s in my test environment.  This mean that 1000 clients
reclaiming locks after failover can easily cause 10s of latency.  This
could cause rpc.statd to become unresponsive, resulting in a time out
for an rpcinfo-based health check of the status service.

Split the add-client/del-client events out to a standalone
statd_callout executable, written in C, to be used as the HA callout
for rpc.statd.  All other functions move to statd_callout_helper.
Now, running a pair of add-client/del-client events in my test
environment averages only ~0.002s.  This seems less likely to cause
latency problems.

The standalone statd_callout executable needs to read a configuration
file, which is generated by statd_callout_helper from the "startup"
event.  It also needs access to a list of currently assigned public
IPs.

For backward compatibility, during installation a symlink is created
from $CTDB_BASE/statd-callout to the new statd_callout, which is
installed in the helper directory.

Testing this as part of the eventscript unit tests starts to become
even more of a hack than it used to be.  However, the dependency on
stubs and the corresponding setup of fake state makes it hard to move
this elsewhere.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Tue Jun 25 04:24:57 UTC 2024 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rpc.statd is single-threaded and runs its HA callout synchronously. If
it is too slow then latency accumulates and rpc.statd's backlog grows.

Running a pair of add-client/del-client events with the current code
averages ~0.030s in my test environment.  This mean that 1000 clients
reclaiming locks after failover can easily cause 10s of latency.  This
could cause rpc.statd to become unresponsive, resulting in a time out
for an rpcinfo-based health check of the status service.

Split the add-client/del-client events out to a standalone
statd_callout executable, written in C, to be used as the HA callout
for rpc.statd.  All other functions move to statd_callout_helper.
Now, running a pair of add-client/del-client events in my test
environment averages only ~0.002s.  This seems less likely to cause
latency problems.

The standalone statd_callout executable needs to read a configuration
file, which is generated by statd_callout_helper from the "startup"
event.  It also needs access to a list of currently assigned public
IPs.

For backward compatibility, during installation a symlink is created
from $CTDB_BASE/statd-callout to the new statd_callout, which is
installed in the helper directory.

Testing this as part of the eventscript unit tests starts to become
even more of a hack than it used to be.  However, the dependency on
stubs and the corresponding setup of fake state makes it hard to move
this elsewhere.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Tue Jun 25 04:24:57 UTC 2024 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Run ShellCheck on event-script unit test support scripts</title>
<updated>2023-07-05T12:16:56+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2023-07-03T02:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d2940694c6a1d7a842d5d91792f36974846da4e0'/>
<id>d2940694c6a1d7a842d5d91792f36974846da4e0</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Wed Jul  5 12:16:57 UTC 2023 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Wed Jul  5 12:16:57 UTC 2023 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Include eventscript stub commands in shellcheck test</title>
<updated>2022-09-16T03:36:32+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2022-08-17T23:36:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0e388a1994e0f6715466eba1d3bdd765c36f956f'/>
<id>0e388a1994e0f6715466eba1d3bdd765c36f956f</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-scripts: Avoid ShellCheck warning SC2164</title>
<updated>2022-07-22T06:38:32+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2022-06-10T00:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3df39aa7fbd6f8712fda3d90a9c595e7d6aadeef'/>
<id>3df39aa7fbd6f8712fda3d90a9c595e7d6aadeef</id>
<content type='text'>
SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

A problem can only occur if /etc/ctdb/ or an important subdirectory is
removed, which means the script itself would not be found.  Use &amp;&amp; to
silence ShellCheck.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

A problem can only occur if /etc/ctdb/ or an important subdirectory is
removed, which means the script itself would not be found.  Use &amp;&amp; to
silence ShellCheck.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-scripts: Drop unused ctdbd_wrapper</title>
<updated>2022-04-06T06:34:37+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2022-01-31T21:35:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8deec3bc67c2831ce63ab4812b6f29baab711b50'/>
<id>8deec3bc67c2831ce63ab4812b6f29baab711b50</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Make unit.sh pass shellcheck</title>
<updated>2020-07-22T07:53:36+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2020-04-30T04:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a369bedf8c5eee75748cdbd6a1a900ca9ac4da9e'/>
<id>a369bedf8c5eee75748cdbd6a1a900ca9ac4da9e</id>
<content type='text'>
Mostly avoidance of quoting warnings.

Silencing warnings about unquoted $CTDB_TEST_CAT_RESULTS_OPTS is
handled by passing '-' to cat when that variable's value is empty.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly avoidance of quoting warnings.

Silencing warnings about unquoted $CTDB_TEST_CAT_RESULTS_OPTS is
handled by passing '-' to cat when that variable's value is empty.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Make integration.bash pass shellcheck</title>
<updated>2020-07-22T07:53:36+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2020-03-05T18:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=be3065ea958b27ec297078008c2ce33b4a419820'/>
<id>be3065ea958b27ec297078008c2ce33b4a419820</id>
<content type='text'>
Apart from the non-constant sourcing of include files.

Mostly avoidance of quoting warnings.

One subtle change is to simply pass "120" to wait_until_ready() to
stop warnings that it expects arguments but none are passed (both
SC2119 and SC2120).  There seems no way to indicate to structure
function argument handling so that shellcheck realises arguments are
optional.  In later shellcheck versions, disabling SC2120 for a
function also silences complaints about its callers... but not all of
our testing uses "later" shellcheck versions.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apart from the non-constant sourcing of include files.

Mostly avoidance of quoting warnings.

One subtle change is to simply pass "120" to wait_until_ready() to
stop warnings that it expects arguments but none are passed (both
SC2119 and SC2120).  There seems no way to indicate to structure
function argument handling so that shellcheck realises arguments are
optional.  In later shellcheck versions, disabling SC2120 for a
function also silences complaints about its callers... but not all of
our testing uses "later" shellcheck versions.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Drop unreachable line</title>
<updated>2020-07-22T07:53:35+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2020-04-30T04:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=0f201dd67a019d4d64011b894ebf542b109afef4'/>
<id>0f201dd67a019d4d64011b894ebf542b109afef4</id>
<content type='text'>
ctdb_test_skip() will exit.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ctdb_test_skip() will exit.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-tests: Redirect stderr too when checking for shellcheck</title>
<updated>2020-07-22T07:53:35+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2020-03-11T05:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=29a3fce28f380e3b5c2e44a697fbf35be2a139da'/>
<id>29a3fce28f380e3b5c2e44a697fbf35be2a139da</id>
<content type='text'>
Avoid:

  .../UNIT/shellcheck/scripts/local.sh: line 14: type: shellcheck: not found

The "type" command in dash prints the "not found" message to stdout
but the bash version prints to stderr, so redirect stderr too.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid:

  .../UNIT/shellcheck/scripts/local.sh: line 14: type: shellcheck: not found

The "type" command in dash prints the "not found" message to stdout
but the bash version prints to stderr, so redirect stderr too.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ctdb-tests: Redirect stderr too when checking for shellcheck"</title>
<updated>2020-07-22T05:07:46+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2020-07-22T04:43:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e4b1cdc7090212c8b2f37b9ba8303439348e00b8'/>
<id>e4b1cdc7090212c8b2f37b9ba8303439348e00b8</id>
<content type='text'>
Fix missing Reviewed-by: tag.

This reverts commit 847aa0e367c721944650aa34d67f8073461ae272.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix missing Reviewed-by: tag.

This reverts commit 847aa0e367c721944650aa34d67f8073461ae272.

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
