Instead of relying on derr to display error messages, add them to an
ostream parameter given in argument to load() and factory(). The erasure
code convenience library no longer depends on the global context that is
indirectly referenced by debug.h
Signed-off-by: Loic Dachary <loic@dachary.org>
The parameters to erasure code do not need to be prefixed with the
erasure-code- string. There only are erasure-code parameters and the
prefix was originaly intended to desambiguate the erasure-code
properties, assuming that the properties map could be used for other
purposes.
Signed-off-by: Loic Dachary <loic@dachary.org>
* Remove the tests checking that a missing or wrong crush_ruleset
parameters triggered an error.
* Add a test checking that a ruleset with the same name as the pool is
created implicitly when no crush_ruleset is specified.
Signed-off-by: Loic Dachary <loic@dachary.org>
If the crush_ruleset parameter is missing, set it to the pool name.
If the crush_ruleset parameter is set to a name that does not match any
of the existing rulesets, create one using the pool creation parameters.
If the ruleset exists and is in the pending map or if the ruleset was
just created (meaning it exists in the pending map), the
prepare_pool_crush_ruleset method returns EAGAIN so that the pool
creation message is retried after the pending map is proposed.
If the ruleset exists, it is used to initialize the newly created pool,
as before.
http://tracker.ceph.com/issues/7571fixes#7571
Signed-off-by: Loic Dachary <loic@dachary.org>
Create the ruleset and branch depending on the result:
* If it succeeds, wait
* If it already exists and is pending (-EALREADY), wait
* If it already exists (-EEXIST), return immediately
* If it fails for other reasons, return immediately
Add an informative message when it succeeds.
Signed-off-by: Loic Dachary <loic@dachary.org>
Avoid using rule instead of ruleset to help clarify the
terminology. Using err instead is also clearer in the context.
Signed-off-by: Loic Dachary <loic@dachary.org>
Only add error message to the stream, not informative messages because
they depend on the caller context.
Signed-off-by: Loic Dachary <loic@dachary.org>
Move the code bloc verbatim, from "osd crush rule create-erasure" to the
new crush_ruleset_create_erasure() method helper. This step helps
separate the code changes from the code moving around unmodified.
Signed-off-by: Loic Dachary <loic@dachary.org>
Fix usage output of ceph_filestore_dump
Add missing error checking
Output full object name
Improve message consistency
Fix program exit value
Signed-off-by: David Zafman <david.zafman@inktank.com>
If the Incremental updates a value that used to equal the old min, we may
have raised it and need to recalculate it at the end. Otherwise, we can
avoid recalculating at all!
Signed-off-by: Sage Weil <sage@inktank.com>
We call this a lot. Only recalculate when we decode or when we apply
an incremental.
Adjust unit test accordingly.
Signed-off-by: Sage Weil <sage@inktank.com>
In file included from test/ceph_argparse.cc:17:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = long unsigned int]’:
../src/gtest/include/gtest/gtest.h:1333:30: instantiated from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = long unsigned int]’
test/ceph_argparse.cc:344:207: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]
Signed-off-by: Sage Weil <sage@inktank.com>
If we are still on monmap epoch 0, our mon ranks cannot yet be trusted
since there is not yet a shared source of truth from paxos. If we do
timechecks, the code gets confused about the ranks in e.g. the
timecheck_waiting map.
Fixes: #7692
Signed-off-by: Sage Weil <sage@inktank.com>
The added case covers a situation where a replica is not contiguous with
the auth_log, but is contiguous with the primary. Reshuffling the
active set to handle this would be tricky, so instead we just go ahead
and backfill it anyway. This is probably preferrable in any case since
the replica in question would have to be significantly behind.
Fixes: #7696
Signed-off-by: Samuel Just <sam.just@inktank.com>
We split global_init_postfork() in two: start and finish, with the first
keeping much of postfork()'s tasks except closing stderr, which we leave
open until just before we daemonize. This allows the user to see any
error messages that the monitor may spit out before it daemonizes, making
sense of the error code (which we were already returning).
Fixes: 7489
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
We were releasing the op locks when we applied the update but (potentially)
before we committed it. This means that another client can read object
state that is not yet durable.
Fixes: #7709
Signed-off-by: Sage Weil <sage@inktank.com>