We should clear addr_name before filling it. Otherwise, the removed
mon will stay there and cause incorrect rank assignment.
Signed-off-by: Henry C Chang <henry.cy.chang@gmail.com>
It is perfectly fine to read events that are older than the fs's seq from
the journal; open() will skip them when positioning the read pointer on
open.
Also, this code is nonsensical; it always failed the assertion.
Signed-off-by: Sage Weil <sage@newdream.net>
last_committed_seq is the last seq committed to the fs, not the journal.
Set it when we begin replay with the fs provided value, not from the newest
entry in the journal.
Signed-off-by: Sage Weil <sage@newdream.net>
Looks like this was missed when flocklock was added. Did a quick grep and
it doesn't look like it is missing anywhere else.
Signed-off-by: Sage Weil <sage@newdream.net>
Otherwise we don't actually journal this value, and we get confused when
we replay a start_truncate and try to restart it.
Fixes: #1756
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If an address isn't explicitly specified during mkfs, look for an unnamed
monitor in the (generated) monmap and see if any of those addresses is
configured on the local machine. If so, assume it's us, and name ourselves
in the seed monmap.
Signed-off-by: Sage Weil <sage@newdream.net>
Previously, the overlaps for snapdirs would not be included in
cstat causing the computed total to be incorrect.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Previously, we accounted for clone space usage inconsistently in
write_update_size_and_usage etc when walking through the operations.
make_writeable may change the most recent clone overlap, however, so we
can't handle it until then.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Shut down MonClient before messenger, to avoid race with MonClient::tick()
and MonClient::shutdown().
Fixes
#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1 0x00007f44475e2849 in _L_lock_953 () from /lib/libpthread.so.0
#2 0x00007f44475e266b in __pthread_mutex_lock (mutex=0x14d8dc8) at pthread_mutex_lock.c:61
#3 0x00000000005ae090 in Mutex::Lock (this=0x14d8db8, no_lockdep=false) at ./common/Mutex.h:108
#4 0x000000000068440e in MonClient::shutdown (this=0x14d8c30) at mon/MonClient.cc:386
#5 0x00000000005b2653 in ceph_tool_common_shutdown (ctx=0x14d84c0) at tools/common.cc:661
#6 0x00000000005ada29 in main (argc=7, argv=0x7fff8a2394c8) at tools/ceph.cc:304
vs
#0 0x00007f44475e8a0b in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
#1 0x00000000005eff6b in reraise_fatal (signum=11) at global/signal_handler.cc:59
#2 0x00000000005f0165 in handle_fatal_signal (signum=11) at global/signal_handler.cc:106
#3 <signal handler called>
#4 0x0000000000000000 in ?? ()
#5 0x000000000068661a in MonClient::tick (this=0x14d8c30) at mon/MonClient.cc:621
#6 0x0000000000689e3b in MonClient::C_Tick::finish(int) ()
#7 0x000000000061b3c5 in SafeTimer::timer_thread (this=0x14d8df8) at common/Timer.cc:102
#8 0x000000000061c6f0 in SafeTimerThread::entry() ()
#9 0x00000000005f1219 in Thread::_entry_func (arg=0x14e1a00) at common/Thread.cc:41
#10 0x00007f44475e0971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#11 0x00007f4445ead92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()
Signed-off-by: Sage Weil <sage@newdream.net>
Different sockaddr_* have the actual address (sin_addr, sin6_addr)
at different offsets, and sockaddr->sa_data just isn't enough.
inet_ntop conspires by taking a void*. I could figure out the right
offset with a switch (found->sa_family), but let's go for the
supposedly write-once-run-with-any-AF solution, getnameinfo.
Which, naturally, takes an extra length argument that is AF-specific,
and not provided anywhere nicely by getifaddrs. Huzzah!
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
The election and some other stuff depend on msg->get_source().num() to get
the peer rank, and that is part of the connection state. If it changes,
we need to close old connections and open new ones so that we aren't
taken for someone else (like mon.-1).
Signed-off-by: Sage Weil <sage@newdream.net>
The rank can change either because we probe and get a new monmap, or
because we get one via paxos. Move the checks to bootstrap() to catch
both cases.
Signed-off-by: Sage Weil <sage@newdream.net>
If we are joining an existing cluster, we can pick whatever address we
want (e.g., one specified by public_addr or public_network).
Signed-off-by: Sage Weil <sage@newdream.net>
Because we have called osr.flush(), it's safe to tag map.valid_through
as last_update. We will still have to catch up once we have stopped
writes and allowed the filestore to catch up anyway.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Instead of specifying an IP address in ceph.conf like
[global]
cluster_addr = 10.1.2.3
you can now avoid the node-specific configuration and just say
[global]
cluster_network = 10.1.2.0/24
The *_network variables can also take a whitespace-separated list of
networks, to be checked in that order:
[global]
cluster_network = 10.1.2.0/24 192.168.42.192/26