Objects can now register as configuration observers interested in a
subset of the configuration keys. The observers will be told exactly
which keys have changed.
The first user is dout, which now no longer needs the infamous SIGHUP
hack to know when to reopen the config file.
librados: Remove rados_reopen_log, which was basically a means for the
library user to trigger the SIGHUP behavior.
Changes are accumulated and applied all at once by apply_changes. This
function is called as part of common_init, and after every call to
injectargs.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Since logging options are per-config, logically DoutStreambuf instances
should also be per-config. This also allows us to eliminate the
"if (uninitialized)" checks at the beginning of every call to dout.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This was used to implement log_to_stdout, but that doesn't exist any
more. Instead of we have log_to_stderr and the other stuff.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
pg_remove has been included for longer than we've had versions
in the struct, so this check for end is useless -- if pg_remove
wasn't encoded we're already broken by decoding the version at
the beginning.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Options that are inherently global, like malloc settings, and also
inherently debugging or profiling settings should be environment
variables.
tcmalloc_profiler_run, profiler_allocation_interval,
profiler_highwater_interval, and buffer_track_alloc fall into this
category.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
We do not need to create the pg on query. If we are a new replica we can
create it when we get the PGLog activate message.
Signed-off-by: Sage Weil <sage@newdream.net>
Remove/zero objects N periods ahead of the journal write position. This
ensures that when we reprobe the journal length, we will always detect the
end position as the correct write_pos, even when there is weird data
"ahead" of us that we may bump up against.
Signed-off-by: Sage Weil <sage@newdream.net>
Make filer::zero() remove any whole objects. This is required by the
Journaler, given the way it probes the journal length.
Signed-off-by: Sage Weil <sage@newdream.net>
If we get an error code and assume we successfully wrote the head,
there are going to be all kinds of issues on replay!
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Fixes bug where oi.size gets out of sync with the object size because we
actually write zeros. (This explains #933.)
Signed-off-by: Sage Weil <sage@newdream.net>
finish_export_inode changes states! That's not good for our checks,
so just handle unpinning and stuff before we finish_export_inode.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We need to handle locks and pins on exported inodes but we
were using a separate if block with its own (non-matching!) check
for no good reason.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Otherwise these pins are never dropped from the inode since we
don't go through our normal xlock teardown code. Now we do!
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We don't want auth_pins on the locallocks (they're never auth_pinned)
and we only want new auth_pins that are for locks on the inode that we
imported -- not for each xlock that the mdr has everywhere (like,
say, on the srcdn)!
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Because we can do an inode import during a rename that skips the usual
channels, we were getting into an odd state with the xlocks (which we
did as a slave for an inode that we exported away). Clean up the
record of these xlocks for inodes before we get into the request
cleanup (at which point we are labeled as no-longer-auth, and the
standard cleanup routines will break).
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Because we can do an inode import during a rename that skips the usual
channels, we were getting into an odd state with the xlocks (which
were formerly remote and are now local). Clean up the record of
those remote xlocks.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
rename all the get_uid_by_* to get_user_info_by_*, remove get_user_info()
and call the appropriate function instead (either the by_uid or by_access_key).
In that case we get ENOSYS. This also implies an old version of the client
and that we should fall back.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We previously dropped the request but that was inappropriate for that
one case because the replica has no way to trigger a resend.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Previously we'd try and do the whole thing, which meant that
the replica got a lock twiddle before it had finished the export.
That broke things spectacularly, since we weren't respecting our
invariants about who gets remote locking messages.
Now we pass through a flag and respect our invariants.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
I don't remember why we needed can_xlock_local() to begin with, but
I can tell that adding this get_xlock_by() check won't stop anything
working that was ever working to begin with (really it's still not
strong enough a check).
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>