IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Commit 207a213c/24fed55d purported to fix the problem of signals during
tdb_new_database (which could cause a spurious short write, hence a failure).
However, the code is wrong: newdb+written is not correct.
Fix this by introducing a general tdb_write_all() and using it here and in
the tracing code.
Cc: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 27ba0e5a6681063225df7244a85aa304c51c6948)
If there's a chance that "ctdb status -Y" can return 0 but print
garbage then this function might return a false positive.
So, we do 2 things:
* Redirect stderr to >/dev/null rather than looking at it. This
minimises the chance that we will see garbage.
* Since we need at least 1 good line to decide the cluster is healthy,
we sanity check each line to esnure it starts with :[0-9].
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d4189c7c3fceaa833f9f0446a2b06af6fed714ec)
Also ensure that $CTDB is set by default it to "ctdb".
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8222fef1e61836b9bfd406205f9ffb9396aa7480)
This currently does "onnode any ... wait_until ...". If ctdbd is
being shutdown on a node then that node might be chosen anyway, if it
is asked early enough. Then we'll loop on that node but our ctdb
client command may always fail, causing a timeout rather than the
expected behaviour.
This puts the loop on the outside of the "onnode any" so that if the
"wrong" node is chosen initially then on the next iteration the choice
can be remade.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a88ee78686bd5aa2b789f5959e0562315a13525d)
It turns out that we *do* want a separate private arg for the message
handler and the completion callback, so we change that.
We also fix the prototypes of the remove_message functions as we
implement them.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 332375246eccd95da626f434f6d49dd9458a9787)
In some contexts ctdb_diagnostics generates too many errors when it is
run on heterogeneous and machine-configured clusters. In some
clusters some nodes are expected to be differently configured and also
machine-generated configured files can have comments containing
timestamps.
This adds some command-line options that can be used to reduce the
number of errors reported:
-n <nodes> Comma separated list of nodes to operate on
-c Ignore comment lines (starting with '#') in file comparisons
-w Ignore whitespace in file comparisons
--no-ads Do not use commands that assume an Active Directory Server
The -n option simply allows ctdb_diagnostics to operate on a subset of
nodes, avoiding file comparisons with and data collection on nodes
that are differently configured. For file comparisons, instead of
showing each file on the current node and then comparing other nodes
to that file, the file from the first (available or requested) nodes
is shown and then other nodes are compared to that. That has resulted
in changes in output - that is, ctdb diagnostics no longer prints
messages referencing the current node.
-c and -w are used to weaken comparisons between configuration files.
--no-ads can be used to avoid running ADS-specific commands if a
cluster uses LDAP (or other non-ADS) configuration.
This also fixes a number of bugs in related code:
* A call to onnode was losing the >> NODE ... << lines because they
now go to stderr. This was changed in onnode long ago but
ctdb_diagnostics was never updated to match.
* ctdb_diagnostics was counting lines in /etc/ctdb/nodes to determine
what nodes to operate on. For some time the nodes file has
supported syntax that makes this invalid. "ctdb listnodes -Y" is
now used to list available nodes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 36c8244a0f68c7c9bbee40982f230e9d14d3c0ea)
These tests currently wait for the old IPs to fail back to the test
node. This isn't guaranteed with DeterministicIPs disabled.
This changes those tests to wait until the test node gets at least 1
IP assigned.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e9b3f5b1b51d541a911a27eb4348b368f28d185e)
Currently we do a "sleep 1" after starting and before running
set_ctdb_variables to set the tunables. This is too arbitrary and
might fail if the system is heavily loaded. This, for example, could
result in some nodes running with DeterministicIPs and some without,
in which case a different IP allocation algorithm would run depending
on who is the recmaster!
This makes the start function wait until "ctdb ping" succeeds (with 10
second timeout) before trying to run set_ctdb_variables. If a timeout
occurs then the start function attempts to kill ctdbd before exiting
with a failure.
It also cleans up the status reporting code for Red Hat and SUSE so
that the final status code is reported. Currently there are cases
where a correct status is prematurely reported before a failure
occurs.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit cdcd05662a30b51caaeeab4ac44138cac2474e0a)
Recent CTDB notice the wrap and print this message. The test needs to
cope.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit b93b60ec96d02ce4f54921e85a5c5554d1fc0c55)
They test debugging commands that no longer operate as expected.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d33fa4d6557aab1938049f194c2de55f2c395bd2)
The test currently checks that all existing IPs plus the newly added
IP are on the test node after "ctdb addip" is run. With
DeterministicIPs enabled, if the new IP is "before" other IPs then the
other IPs may be shuffled by the deterministic IPs modulo algorithm.
This will happen on the 1st recovery after the move. Sometimes this
recovery happens before we get the list of IPs to check and sometimes
after, so the test is racy.
The fix is to simply check for the presence of the new IP and not
worry about the others. This reduces whatever value this test
had... but you can't have everything.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 1ef7c8e64c7a39330be09ae4d00b70238133e0b5)
This test is failing in some situations. The "ctdb addip" command
works but the IP never appears in the "ctdb ip" output.
Try restricting the last octet to be between 101-199. At the moment
addresses like 10.0.2.1 are being chosen and these are often the
address of the host machine in autocluster configurations... so might
cause weirdness.
Also add some debugging if checking for the IP address times out.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ae52cb63756bc60de8d32e01bac5d70975a1c7a0)
Group options better and make the language consistent between options.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit bc38c17e4115fae00c89d00537fdcfe621111b37)
This can imply something about imbalance.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit ecb80e2b6be9326708d1fc87ad3028c6836d5858)
Tweak the usage message for -g option.
Print an error if no node groups defined, instead of curious Python
error.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8b883eb9346b8278d268e35b56ac680cd9526b97)
This allows node pool configuration to be specifed on the
command-line.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d382d9023928f75f360a115ae1e9c1036423416e)
The current code makes random choices from unsorted lists. This
ensures the lists are sorted.
Also, make the code easier to read by doing the random selction from
lists of PNNs rather than lists of Node objects.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a01244499dc3567f5aa934b1864b9bc183a6c242)
process_args() must now be called by programs inporting this module.
Options are put into global variable "options", which can be
references using "ctdb_takeover.options".
Can now pass extra option specifications to process_args().
Remove global variable prev and make it a Cluster object variable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a32298e7bc819694518e859f100f9444ff5663cd)
There's a lot of new code here, so let's make the copyright message
make sense.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e6e56e5989def6704b116e806c1f261c7f3fc03f)
We don't need to see warnings about unallocatable IPs unless we're in
verbose mode. Can node be run with -n (and without -v or -d) to see
just the statistics.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 55370936ac5def5ebf138910388a2ddc2df9c20f)
This is useful to know. When things get unbalance they tend to stay
that way.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a40faa2096effc2657ac05b729f3259bbb2e1fed)
This starts at -1 because we always have to do the initial allocation.
No longer print event number for each event by default, only when
verbose is enabled.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit c9a761726d141bcaa8ba7851150f71a8130b473a)
Implement the imbalance calculations.
Also add command-line option to display imbalance for each step.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit f50a12f6d06ed67efadd2a892d62c01e67310e7d)
Includes simulation module and example scenarios. This allows you to
test and perhaps tweak an algorithm that should be the same as the
current CTDB IP reallocation one.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit d148e7a7cb840febbdf56ba2e39c314cc2d7ac24)
Currently the file for each IP address is reopened to append the
details of each source socket.
This optimisation puts all the logic into awk, including the matching
of output lines from netstat. The source sockets for each for each
destination IP are written into an array entry and then each array
entry is written to the corresponding file in a single operation.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6549e9b01538998d51a5f72bfc569776d232b024)
Includes simulation module and example scenarios. This allows you to
test and perhaps tweak an algorithm that should be the same as the
current CTDB IP reallocation one.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 10e701fa9bba2a166c947a5a18f231ff64d9b861)
In include/ctdb.h, ctdb_callback_t and ctdb_rrl_callback_t were
defined with a void *private variable. The variable name was
changed to void *private_data to avoid issues encountered in
the Samba autoconf script.
Evan Kinney <evan.kinney@sas.com>
(This used to be ctdb commit 1f453aa4b5e749468c7788afac09c6f0900ea18f)
Currently the file for each IP address is reopened to append the
details of each source socket.
This optimisation puts all the logic into awk, including the matching
of output lines from netstat. The source sockets for each for each
destination IP are written into an array entry and then each array
entry is written to the corresponding file in a single operation.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 53e6b9d1ba379ae27433871d1741c894cd71ccc1)