Instead of recalculating the hash every call, do it once, and pass this
structure around. Also, will be used for logging changes into the data
log.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
bucket shard can be specified on the bucket instance param. It can be
added like this: <bucket-instance>[:shard-id]
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Turned the ConcurrentIO class a template, so that we could use different
kind of containers that are needed for the different operations.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Instead of copy pasting the same code all over again, create a base
class for the needed concurrent IO operations.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Previous we would queue lots of distinct encoded Transactions from various
callers, usually one per PaxosService. These would be sent through paxos
one at a time.
If there is a completed transaction there is no reason to delay; it is
more efficient to push it through immediately. Since we will propose
anything pending right when we finish, there is minimal opportunity for
other work to get done.
Instead, accumulate everything in a single MonitorDBStore::Transaction and
propose all pending changes all at once. Encode at propose time and
expose the Transaction to the callers so they can add their changes.
Signed-off-by: Sage Weil <sage@redhat.com>
The whitespace for the current pretty mode is awkward and weird. Move
to a more standard approach. It's more newlines, but *much* more
readable.
Signed-off-by: Sage Weil <sage@redhat.com>
Previously was set in hashbang, which meant
that "./quota.sh" was OK, but "sh ./quota.sh" would
just run through ignoring errors.
Signed-off-by: John Spray <john.spray@redhat.com>
When set min_size value:
A:for replicated pool, the value must be between in 1 and size
B:for erasure pool, the value must be between in data_chunk_count)
and size(data_chunk_count + code_chunk_count).
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
AIO requests that are waiting on the image lock should be flushed
during all existing RBD flush scenarios. A few flush cases were
missed in the original implementation.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new RBD exclusive lock feature should be treated as a
feature that is only applied when the image is opened in
R/W mode.
Older clients will need to handle the updated
cls_rbd::get_features method in order to properly determine
the incompatible features for an image depending on the
current mode.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new unit tests cover the modifications made to integrate
the internal librbd functionality with the new ImageWatcher.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Directly unit test the new ImageWatcher class to complement
the existing librbd integration tests of exclusive lock
handling.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Unit tests need access to the private symbols of librbd no
longer exported from librbd.so. A new librbd_internal
convenience library was created to allow access.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Operations that update the image now require the exclusive lock
if the feature is enabled. AIO write and discard operations will
automatically request the exclusive lock from the current leader
to support live-migration.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
As a follow-on to 49d114f1ff,
increment the "extra" version field so clients can easily
determine if they have a version of librados that properly
translates C API operation flags.
Signed-off-by: Matthew Richards <mattjrichards@gmail.com>