]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-scripts: Improve update and listing code
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 2 Aug 2023 03:23:58 +0000 (13:23 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 13 Dec 2024 13:57:32 +0000 (13:57 +0000)
commite6a85d128f7ada419fc13ca72a295533674e7840
treea7e029dbdd6cf7215d6030a88c64db3e3bf51fcd
parentb8fe8a5fd277f60ccc07ac64dff067255aff4f11
ctdb-scripts: Improve update and listing code

Drop the complexity associated with using awk to escape dots in IPv4
addresses to protect them from sed, and generate a grep -F filter
instead.

For listing, the pipeline is now longer, but the steps are now
clearer:

1. List DB records
2. Extract keys
3. Keep only keys machine hosted public IPs
4. Parse out server IP and client IP
5. Sort

Performance here isn't critical, so having clearer code is preferable.

Use temporary files to avoid command-line length limits.

Also, drop the cd to the queue directory during update.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tools/statd_callout_helper