1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

4868 Commits

Author SHA1 Message Date
Martin Schwenke
0e9c939c0c eventscripts: Remove TCP port checks other than the built-in CTDB one
"ctdb checktcpport" is no longer experimental so the other checkers
are no longer required.

Remove tests related to the removed checkers.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 50e330d0679614bee2e7bab028436e929f74ca50)
2013-10-22 14:34:04 +11:00
Martin Schwenke
d02a645691 scripts: Remove setting of PATH from functions file
The current setting is inconsistent with settings on most systems,
putting /bin before /sbin.  Use of /usr/local/bin, which may be
required on some systems, is also overridden.  This can make it
difficult to do interactive debugging of script problems.

Rely on the system PATH instead.

If system-specific changes need to be made then this can be done in a
configuration file.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit cfbff39e22e42f3997f637290748290833525714)
2013-10-22 14:34:04 +11:00
Martin Schwenke
5d65335d60 tests/eventscripts: Run scripts under sh by default
Some scripts are disabled by default so are no executable.  Explicitly
running them under sh allows them to be run without having to mess
around and make them executable or similar.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9437d4809bfbbb5c6a32a610665333d2f641881d)
2013-10-22 14:34:04 +11:00
Martin Schwenke
05f5fe9179 tests/eventscripts: New tests for 20.multipathd
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 212d4b201c30804f69cffe4b7150d4b74bf2e54f)
2013-10-22 14:34:04 +11:00
Martin Schwenke
1ede20925f eventscripts: Clean up 20.multipathd
Reduce the complexity, including the depth of background processes.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 49f077c475b078889ff0492fe7d567a64d6cb87c)
2013-10-22 14:34:04 +11:00
Martin Schwenke
1e4c965f52 eventscripts: NAT gateway script should export CTDB_NATGW_NODES
Otherwise calls to "ctdb natgwlist" will not behave as expected if a
non-standard file is used, since that command will use the default
file location.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e574b30257126679704b088c4334a8e7a53a9c3f)
2013-10-22 14:34:04 +11:00
Martin Schwenke
cd4041760b scripts: Simplify script_log() to just look at CTDB_SYSLOG variable
The old logic was actually wrong.  If CTDB_LOGFILE is unset then a
default is used, not syslog.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 79e2029f9bc078126e865aa715100a3870c7604b)
2013-10-22 14:34:04 +11:00
Martin Schwenke
4526fdbbca scripts: Remove support for CTDB_OPTIONS configuration variable
Allowing people to put random options in CTDB_OPTIONS complicates some
logic (particularly around use of syslog).  If we're going to have
variables for options then let's make sure we have a variable for each
option and make people use them.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit e55f3a1577eff0182802b0341d865d961aeae1c7)
2013-10-22 14:34:04 +11:00
Martin Schwenke
1043b53d12 scripts: Remove unused configuration variable CTDB_MANAGES_SCP
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit bda0da41aaf629a252cc361b73ebc5328f26ed04)
2013-10-22 14:34:03 +11:00
Martin Schwenke
04f67b1066 eventscripts: Deprecate NFS_SERVER_MODE, use CTDB_NFS_SERVER_MODE instead
All CTDB configuration variables should start with CTDB_.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f12658aff125996ae45eea23241d8c3d0567b893)
2013-10-22 14:34:03 +11:00
Martin Schwenke
fbd2617cb8 recoverd: Remove function reload_nodes_file()
It is a 1 line wrapper around ctdb_load_nodes_file(), so use that
instead.  We need less code...  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 4a5d5935f4410a93a3343d85a24dbcddae2c4c20)
2013-10-22 14:34:03 +11:00
Martin Schwenke
a93361fca2 Revert "null out the pointer before we reload the nodes file"
This reverts commit 4b0f32047e8bece0a052bdbe2209afe91b7e8ce3.

This is not necessary.  It just causes a memory leak.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 25fd05505f61dc595c0ef25bb6e332274d5530e8)
2013-10-22 14:34:03 +11:00
Martin Schwenke
19a911bf1a client: Fix a format string argument compiler warning
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f3413fb8b90c4d9f0c2c2a69825c66d080117193)
2013-10-22 14:34:03 +11:00
Amitay Isaacs
e63232e974 recoverd: Ignore failed flag updates on inactive nodes
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 484c46eaae056480baf050fd91868f2fd0537985)
2013-10-22 14:34:03 +11:00
Amitay Isaacs
a42b6e1cad common/util: Use AIX specific code for setting high priority for CTDB daemon
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7764cf67a61bbf1caad5aa8e2d75a262b9da654c)
2013-10-22 14:33:56 +11:00
Martin Schwenke
63c534b1e2 git: Ignore generated documentation files
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b9af66032f3d96f2fe12b7a4fcc5e71d4a282365)
2013-10-22 13:07:13 +11:00
Martin Schwenke
5e0eb7bf84 tests: When running local tests with run_tests.sh, use fixed TEST_VAR_DIR
Otherwise we end up with lots of useless temporary directories.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 63924ff372b066cd878b79e71f06de4c24c814a2)
2013-10-22 13:07:13 +11:00
Martin Schwenke
ace6c1ee62 eventscripts: Fix comment - CTDB_TCP_PORT_CHECKS -> CTDB_TCP_PORT_CHECKERS
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 0a79ba2f1277a776347e2c3f04ce8419e0be62de)
2013-10-22 13:07:13 +11:00
Martin Schwenke
9256010cfb tests/integration: Tweak ctdbd startup options
* --public-interface is not needed

* Add --sloppy-start to speed up restarts

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit d0dec5b8e60316701fdd02150c4dd8f01aacbfda)
2013-10-22 13:07:13 +11:00
Martin Schwenke
4812291ff8 recoverd: Fix the VNN lmaster consistency check
It does cope with node that don't have the lmaster capability.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 588172bcb6bf267339e2bd09e23d2c4904a27a41)
2013-10-22 11:49:54 +11:00
Amitay Isaacs
ec7c9952d5 tests: If transaction_start fails, try again
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ed7d999214ee009e480c26410a04fa105028cb8e)
2013-10-08 17:10:13 +11:00
Amitay Isaacs
30f422b960 tests: Make sure test exits with zero status on successful completion
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit af4b6b8b3222d2a3c425fcc6833db579d0cd7ffa)
2013-10-08 17:10:08 +11:00
Amitay Isaacs
dae9e86461 tests: Re-enable transaction test code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 929045335212e825deb645cc6c7f97b8a40fdbb3)
2013-10-04 15:47:11 +10:00
Amitay Isaacs
c4a80c7a67 tools/ctdb: Remove setdbseqnum command
This command was added to test persistent database recovery with sequence
numbers.  With the new persistent transaction code, sequence numbers get
updated automatically, so there is no need for this command.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 14bfd22fad1a5fd27eede1be7fccbaed9466e13e)
2013-10-04 15:47:11 +10:00
Amitay Isaacs
524696fa26 tests: No need to set sequence number when modifying persistent database
With the new persistent transaction code, sequence numbers will be
automatically updated whenever a record is updated.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 961dd5d0acbb971756944ea9f69992020ea7d9fc)
2013-10-04 15:47:11 +10:00
Amitay Isaacs
d0f99926e4 client: Remove old persistent transaction code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 41bdbcfd72092cdd25da87e60689c087bca97933)
2013-10-04 15:47:11 +10:00
Amitay Isaacs
c5ec04f24e client: Reimplement persistent transaction code using TRANS3_COMMIT
Implementing persistent trasnaction code from Samba.

Persistent transaction code was reimplemented in Samba using g_lock.tdb
to hold transaction locks and using TRANS3_COMMIT control.

Implementation details:

1. When starting a transaction, create a record with "transaction-<dbid>"
   as key and store current server_id in the structure.

2. If a record already exists, some other client has already started a
   transaction.  Verify that the process corresponding to server_id stored
   in the record really exists or it's a stale record and overwrite it.

3. All modifications to the actual persistent database are stored in a
   marshal buffer.

4. When transaction is committed, read the sequence number of the
   persistent database and increment it.  Sequence number record is also
   stored in the marshal buffer.

5. Send the changed records (marshal buffer) in TRANS3_COMMIT control
   to all the active nodes.

6. If all controls succeed, verify that the sequence number has been
   incremented.  Commit is successful.  If any of the controls fail,
   abort the transaction.

7. In case sequence number has not yet been incremented, then database
   recovery has been triggered.  So repeat from step 5.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 4e0f1971792c9431d8d51dc57d54ecc9e4576dd5)
2013-10-04 15:46:15 +10:00
Amitay Isaacs
1203e82d9b client: Add functions to parse g_lock.tdb records
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 40589ae5259880431f358250c1f0d07bcaa21d1f)
2013-10-04 15:43:32 +10:00
Amitay Isaacs
0205d52657 client: Add functions to handle server_id structure
server_id records are stored in g_lock.tdb for persistent transactions.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 55f91ea4373c54ddb5faad87fa2826d86a4b6172)
2013-10-04 15:43:31 +10:00
Amitay Isaacs
be33efa3e4 ctdbd: Remove transaction code related to TRANS2 commits
This removes data types and structure elements related to TRANS2
persistent transaction code.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 22a253b7ccf1ff854cddf0b67969dc84d7d6a654)
2013-10-04 15:20:25 +10:00
Amitay Isaacs
91d644325d ctdbd: Deprecate TRANS2 commit controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 7d176352986317e63696d74252ff5d8eccb2fee5)
2013-10-04 15:20:25 +10:00
Amitay Isaacs
1ff9645865 ctdbd: Create a utility function to log error for "not implemented" controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 3c892ea1b5aa42686adb82ce29b9fcfdf9d204a1)
2013-10-04 15:20:25 +10:00
Amitay Isaacs
fe62936bb6 include: Remove unused set_dmaster structure
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 2ce3a48cc969d563c26dd295723416c0d7b077a2)
2013-10-04 15:20:25 +10:00
Martin Schwenke
24fb430d6e tests/tool: Remove references in libctdb in file and function names
Main changes are:

  libctdb_test.c -> ctdb_test_stubs.c
  ctdb_tool_libctdb.c -> ctdb_functest.c

ctdb_tool_stubby.c is gone, replaced with existing ctdb_test.c.

Functions starting with "libctdb_test_" now start with
"ctdb_test_stubs_".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 6182bd0c19f215a997efe5272e633b1b1bd0c882)
2013-10-04 15:15:35 +10:00
Martin Schwenke
f3b1790819 tests/tool: Rework test programs so they no longer expect libctdb
Instead, override controls using preprocessor magic.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 10aac42f30cc0d56dca42ece17d04ccbc321056d)
2013-10-04 15:15:35 +10:00
Martin Schwenke
a6992b7b07 tests/tool: Fix some comment typos
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 59bd4ede15a5958b87e0d253461eb9111885bd2f)
2013-10-04 15:15:35 +10:00
Martin Schwenke
7a3e2f1627 tools/ctdb: Stop return value from being clobbered in control_lvsmaster()
ret is initialised too early and is clobbered by the call to
ctdb_ctrl_getcapabilities().  Initialising it later means that the
function returns -1 when no LVS master is found.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3296559c43e70f755fcf2c06677891e0319c8142)
2013-10-04 15:15:35 +10:00
Martin Schwenke
b527236efe client: Fix some format string compiler warnings
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 5619754343003016ede27014567dbb4701f97928)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
e229ff6133 common: Fix setting of debug level in the client code
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 299fa487549e36572b757852d21471f9e23f6e8f)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
7a8337a01d libctdb: Remove incomplete libctdb
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c5a7f2b4ff011e1393c4ff34864f85e6b472ff07)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
2b68d143cb tools/ctdb: Pass memory context for returning nodes in parse_nodestring
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1585a8e275b0143e5e46311b3d5e9785119f735f)
2013-10-04 15:15:35 +10:00
Amitay Isaacs
d4643abe88 tests: Do not use libctdb code in tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ae0d8f432ef98a72c85a6cd42c503b718bef0e4e)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
03379e332c tools/ctdb: Do not use libctdb for commandline tool
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit cd66282c635cf53386d8970b89c895076ea21cbd)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
4ca9b96114 client: Add ctdb_ctrl_getdbseqnum() function
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8cb1fbbfe88327c9c7ab68e8eded586dff611e57)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
5d47f28e15 client: Add ctdb_ctrl_getdbstatistics() function
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1e7fca5cdc1d7205cf084e35aace1a5dc46ea294)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
105afa543e client: Add ctdb_client_check_message_handlers() function
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit c9a9d14c91f203ce964a426a8a1e2c1715af2098)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
151bb4b97d client: Remove extra whitespaces
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 962eb63c6d500e29a03ae087757d81be449888c6)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
2814c9a0c5 tests: Remove unused test program ctdb_fetch_lock_once
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 873b9cadbcc363a9e5f450b0a1feb1cf2ce1e6c9)
2013-10-04 15:15:34 +10:00
Amitay Isaacs
f165ed1594 tools/ctdb: When printing TDB data as a string, use correct length of the string
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit d94a10f93a0925b17458d009e604966666b3d880)
2013-10-04 15:15:27 +10:00
Amitay Isaacs
d3783ae140 tools/ctdb: Remove un-implemented ctdb vacuum command
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 8b238852884004a56f76a1762199c338864d1249)
2013-10-04 15:15:27 +10:00