summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * client: Reimplement persistent transaction code using TRANS3_COMMITAmitay Isaacs2013-10-042-5/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * client: Add functions to parse g_lock.tdb recordsAmitay Isaacs2013-10-041-0/+198
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 40589ae5259880431f358250c1f0d07bcaa21d1f)
| * client: Add functions to handle server_id structureAmitay Isaacs2013-10-041-0/+66
| | | | | | | | | | | | | | | | 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)
| * ctdbd: Remove transaction code related to TRANS2 commitsAmitay Isaacs2013-10-045-323/+4
| | | | | | | | | | | | | | | | | | 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)
| * ctdbd: Deprecate TRANS2 commit controlsAmitay Isaacs2013-10-042-12/+11
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7d176352986317e63696d74252ff5d8eccb2fee5)
| * ctdbd: Create a utility function to log error for "not implemented" controlsAmitay Isaacs2013-10-041-4/+15
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 3c892ea1b5aa42686adb82ce29b9fcfdf9d204a1)
| * include: Remove unused set_dmaster structureAmitay Isaacs2013-10-041-6/+0
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2ce3a48cc969d563c26dd295723416c0d7b077a2)
| * tests/tool: Remove references in libctdb in file and function namesMartin Schwenke2013-10-047-62/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * tests/tool: Rework test programs so they no longer expect libctdbMartin Schwenke2013-10-044-285/+291
| | | | | | | | | | | | | | | | Instead, override controls using preprocessor magic. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 10aac42f30cc0d56dca42ece17d04ccbc321056d)
| * tests/tool: Fix some comment typosMartin Schwenke2013-10-042-2/+2
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 59bd4ede15a5958b87e0d253461eb9111885bd2f)
| * tools/ctdb: Stop return value from being clobbered in control_lvsmaster()Martin Schwenke2013-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | 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)
| * client: Fix some format string compiler warningsMartin Schwenke2013-10-041-2/+4
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 5619754343003016ede27014567dbb4701f97928)
| * common: Fix setting of debug level in the client codeAmitay Isaacs2013-10-041-0/+7
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 299fa487549e36572b757852d21471f9e23f6e8f)
| * libctdb: Remove incomplete libctdbAmitay Isaacs2013-10-0442-6319/+1
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c5a7f2b4ff011e1393c4ff34864f85e6b472ff07)
| * tools/ctdb: Pass memory context for returning nodes in parse_nodestringAmitay Isaacs2013-10-042-8/+9
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1585a8e275b0143e5e46311b3d5e9785119f735f)
| * tests: Do not use libctdb code in testsAmitay Isaacs2013-10-043-54/+24
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ae0d8f432ef98a72c85a6cd42c503b718bef0e4e)
| * tools/ctdb: Do not use libctdb for commandline toolAmitay Isaacs2013-10-042-109/+202
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit cd66282c635cf53386d8970b89c895076ea21cbd)
| * client: Add ctdb_ctrl_getdbseqnum() functionAmitay Isaacs2013-10-042-0/+36
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8cb1fbbfe88327c9c7ab68e8eded586dff611e57)
| * client: Add ctdb_ctrl_getdbstatistics() functionAmitay Isaacs2013-10-042-0/+56
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 1e7fca5cdc1d7205cf084e35aace1a5dc46ea294)
| * client: Add ctdb_client_check_message_handlers() functionAmitay Isaacs2013-10-042-1/+38
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c9a9d14c91f203ce964a426a8a1e2c1715af2098)
| * client: Remove extra whitespacesAmitay Isaacs2013-10-041-3/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 962eb63c6d500e29a03ae087757d81be449888c6)
| * tests: Remove unused test program ctdb_fetch_lock_onceAmitay Isaacs2013-10-042-153/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 873b9cadbcc363a9e5f450b0a1feb1cf2ce1e6c9)
| * tools/ctdb: When printing TDB data as a string, use correct length of the stringAmitay Isaacs2013-10-041-1/+1
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit d94a10f93a0925b17458d009e604966666b3d880)
| * tools/ctdb: Remove un-implemented ctdb vacuum commandAmitay Isaacs2013-10-042-10/+0
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8b238852884004a56f76a1762199c338864d1249)
| * tests: Add a simple test to test cluster wide database traverseAmitay Isaacs2013-09-261-0/+73
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 713c9ecc791e3319a2d109838471833de5a158c8)
| * traverse: Send traverse end record from traverse child processAmitay Isaacs2013-09-251-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traverse records are sent directly from traverse child process, but the last empty record signalling end of traverse is sent from ctdbd. This creates a race condition between ctdbd and traverse child. There are two fds from traverse child to ctdbd - a pipe to track status of the child process and unix socket connection for sending records. It's possible that last few records are sitting in unix socket buffer when ctdbd reads the status written from traverse child. This will be interpreted as end of traverse and ctdbd will send the last empty record to originating node before it has processed the pending packets in unix socket connection. The race is avoided by sending the last empty record marking end of traverse from the child process. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 37e22fc3ac3eb64732f2e67058f5b7b06c093fbf)
| * traverse: Wait till all data has been flushed from output queueAmitay Isaacs2013-09-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To improve the traverse performance, records are directly sent from traverse child process to the originating node. Make sure that all the data is sent via socket, before informing ctdbd that traverse is complete. Without waiting for all the packets to be flushed from the queue, child process can incorrectly signal ctdbd that traverse has ended. This will cause the pending records in the queue never to make it to the originating node and traverse information will not be complete. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 482ac708cb79cb6378d814a79c2cf13f88435bc4)
| * traverse: Use ctdb local variable for convenienceAmitay Isaacs2013-09-251-3/+3
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 25e9cf86328252f96215b54b94551dd7bbdd2db4)
| * traverse: Check if local traverse failed or succeededAmitay Isaacs2013-09-251-10/+32
| | | | | | | | | | | | | | | | | | | | By passing the result of tdb_traverse_read() allows ctdbd to determine if the local traverse succeeded or not. In case of a problem with local traverse, ctdbd can log an error. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit abd51a9f41ebb178c4ea4491bdedf9a9433e7232)
| * traverse: Log information when traverse starts and endsAmitay Isaacs2013-09-251-2/+11
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit e4aba8598b00a810e721de64ac44dccc9af04ab6)
| * tool/ltdbtool: -h option does not require an argumentMartin Schwenke2013-09-251-1/+1
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 9e18f3c173863919587e25d704f66372624ed8ed)
| * scripts: Add support for optional ctdbd.conf configuration fileMartin Schwenke2013-09-251-0/+7
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 8f660d0dd52013e5876806be908e8e603aa6e968)
| * utils: Make debug level strings case-insensitiveMartin Schwenke2013-09-251-1/+1
| | | | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit c700dd0c7b6b43b61b3e231643b5d7cbe2f9592a)
| * tools/ctdb: Fix help messages for ctdb commandsMartin Schwenke2013-09-251-4/+4
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 49c87699fad151933a0aefebfee968fc850e6383)
| * tools/ctdb: Ban time of 0 is invalidMartin Schwenke2013-09-251-0/+5
| | | | | | | | | | | | | | | | | | Apparently it used to mean a permanent ban but it is unclear if this was ever supported. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c8a6e5ce579e2fe320c40268e7e9ddfe68b8cd30)
| * eventscripts: Load CTDB configuration settings in 70.iscsiAmitay Isaacs2013-09-231-0/+2
| | | | | | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ff41ce5ef202f8f6342e285d195bb5df61d848ce)
| * recoverd: Disable takeover runs on other nodes for 5 minutesMartin Schwenke2013-09-191-2/+2
| | | | | | | | | | | | | | | | | | 60 seconds might not be long enough to kill all connections and release IPs. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 71080676bb4acbd0d9b595a30cf7fe6dddbf426f)
| * recoverd: Improve logging for takeover runsMartin Schwenke2013-09-191-1/+5
| | | | | | | | | | | | | | | | | | Takeover runs are currently silent when they succeed. However, they are important, so log something by default. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit b39aa2e401fbb581207d986bac93778e9c01acdc)
| * tools/ctdb: Use the standard long timeout when disabling takeover runsMartin Schwenke2013-09-191-2/+4
| | | | | | | | | | | | | | | | | | This means that takeover runs will be disabled for about as long as the reloadips control can take to complete. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6d44657a5e5b0df22bab2d487a503dd1c5ba79b4)
| * tools/ctdb: Fix arguments/semantics of rebalance nodeMartin Schwenke2013-09-191-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason why specifying a node should be compulsory. This is a cluster-wide operation because it is implemented by the recovery master so multiple nodes should not be specified using -n. However, the command should be able to specify multiple nodes so let it have its own nodestring argument. This change should be backward compatible with the old requirement of specifying a single node via -n. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0846c00597adb66bba8c9dbf63443d0c2f91a7d1)
| * tools/ctdb: Make rebalancenode more robustMartin Schwenke2013-09-191-8/+4
| | | | | | | | | | | | | | | | | | | | Use a broadcast instead of trying to win the race of determining the recovery master and then sending the message before the recovery master changes. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ac946ee4ad01b1e5cd1006930b9f8a190a0a58ba)
| * tests/simple: Fix the reloadips test to cope with changes to reloadipsMartin Schwenke2013-09-191-3/+3
| | | | | | | | | | | | | | | | Specifying nodes to reload no longer uses -n. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d921b2756d5f1c4ad7a35fe120f6fda9f5bf5686)
| * recoverd: Be careful about freeing the list of IP rebalance target nodesMartin Schwenke2013-09-191-1/+7
| | | | | | | | | | | | | | | | | | | | | | It can change during a takeover run. If it does then don't free it. There are potentially fancier solutions (e.g. check what PNNs are new to the list) to this issue but this is the simplest. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e81589b7084c661adf617e166cc2c25b4939f841)
| * recoverd: reloadips should rebalance target nodes for new IPsMartin Schwenke2013-09-191-0/+20
| | | | | | | | | | | | | | | | | | | | Otherwise, if existing IPs are added to extra nodes (that have, perhaps, been disconnected) then those IPs will not be rebalanced across the extra nodes. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ceb30432a9a550778aed0b422a654fc5287b82a3)
| * ctdbd: Make ctdb_reloadips_child send controls asynchronouslyMartin Schwenke2013-09-191-42/+90
| | | | | | | | | | | | | | | | | | | | | | Deleting IPs can take a while because IPs are released and connections are killed. This can take a while so do them in parallel. In fact, since the set of IPs being added and deleted will be disjoint, send all the adds/deletes at the same time and then wait. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 85a5b544ec032173e98c9cc3b5402a76b961aa3b)
| * recoverd: Fix the implementation of CTDB_SRVID_REBALANCE_NODEMartin Schwenke2013-09-194-66/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation has a few flaws: * A takeover run is called unconditionally when the timer goes even if the recovery master role has moved. This means a node other than the recovery master can incorrectly do a takeover run. * The rebalancing target nodes are cleared in the setup for a takeover run, regardless of whether the takeover run succeeds. * The timer to force a rebalance isn't cleared if another takeover run occurs before the deadline. Any forced rebalancing will happen in the first takeover run and when the timer expires some time later then an unnecessary takeover run will occur. * If the recovery master role moves then the rebalancing data will stay on the original node and affect the next takeover run to occur if the recovery master role should come back to the original node. Instead, store an array of rebalance target nodes in the recovery master context. This is passed as an extra argument to ctdb_takeover_run() each time it is called and is cleared when a takeover run succeeds. The timer hangs off the array of rebalance target nodes, which is cleared if the node isn't the recovery master. This means that it is possible to lose rebalance data if the recovery master role moves. However, that's a difficult problem to solve. The best way of approaching it is probably to try to stop the recovery master role from jumping around unnecesarily when inactive nodes join the cluster. The long term solution is to avoid this nonsense completely. The IP allocation algorithm needs to cache state between runs so that it knows which nodes have just become healthy. This also needs recovery master stability. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c51c1efe5fc7fa668597f2acd435dee16e410fc9)
| * recoverd: Remove unused CTDB_SRVID_RELOAD_ALL_IPS and handlerMartin Schwenke2013-09-192-93/+0
| | | | | | | | | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 4cd727439a0824ebb8dbcf737d9888ffc3c41184)
| * tools/ctdb: Reimplement reloadipsMartin Schwenke2013-09-191-70/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation disables takeover runs on all nodes before trying to reload IPs. It also takes "all" or the list of PNNs as an argument to the command instead of to -n. -n can still be specified with a single node indicating that node should be considered the current node - that might be confusing so could be removed. This implementation does not use CTDB_SRVID_RELOAD_ALL_IPS, so it can be removed. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d66a072d9b120c78c47e726e9f29a3c1cfdd87ce)
| * recoverd: Defer ipreallocated requests when takeover runs are disabledMartin Schwenke2013-09-191-1/+2
| | | | | | | | | | | | | | | | | | The takeover run will fail anyway but deferring seems like a cleaner option. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 428f800bcdf3dbfe19de8bb36099fbf01ebeaab4)
| * recoverd: Reimplement CTDB_SRVID_DISABLE_IP_CHECKMartin Schwenke2013-09-191-51/+37
| | | | | | | | | | | | | | | | | | Use disable_takeover_runs_handler() instead of maintaining duplicate logic. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0a51a85915486b2a8fded7ba6444b18c6c1ee8e8)