ObjectCacher will never do short reads, and always returns 0.
librados may do short reads at the end of an object.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
librados does this for us normally, but caching does not check for this.
We might as well check early to avoid scheduling a bunch of aios anyway.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Abstract out how writeback is done with a WritebackHandler object.
For RBD caching, this will be done by librados, but the Client uses
the Objecter directly.
This also requires different locks, since librbd does not have access
to the lock the underlying Objecter uses. Thus, both lock and the
writeback handler are parameters of the ObjectCacher constructor.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Now the ObjectCacher has no need for a Filer instance (not that
it had a good reason for one before).
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Call user completions in an async thread. This allows callers to call back
into librados from the callback, and allows them to take locks in their
callbacks that they hold when queuing requests (making their life much
easier).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We write to the object being cloned prior to the clone to ensure we are
cloning a valid range of bytes.
The write and the clone were being done in two distinct transactions,
which would trigger a diff mismatch if a failure happened to occur within
the write tx. By not differentiating the transactions when building a
pristine copy, we were executing one more transaction (the clone_range one)
than the transactions that were executed in the failed filestore, thus
triggering the mismatch (one more object in the pristine filestore than on
the failed filestore).
Now we issue a single transaction, containing both the clone_range()
preceded by a write().
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
ENOENT in those contexts means that the object_map does not know
about the object, not that the object does not exist.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Otherwise we don't get the option for FileStore instances created after
common_init_finish() (which does md_config_t::call_all_observers()).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We need to allow the perfcounter name to be controlled so that we can have
two instances of FileStore in the same process that don't step on each
other. Default to 'filestore'.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
With this test we aim at reproducing the same sequence of transactions
as long as we are provided with the same seed between runs.
We also allow failures to be injected onto the filestore if the
--filestore-kill-at <VAL> argument is passed, and we provide verification
when --test-verify-at <VAL> is provided.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>