The test was removed in 1189138 (mon: make ceph tell mon.* version
work) as it began to fail due to #10439. After it fixed in c4548f6
(pybind: ceph_argparse: validate incorrectly formed targets), the test
can be restored.
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Google Testing Framework is included by default within the Google
C++ Mocking Framework. Update makefiles to use new gmock/gtest
libraries and remove old gtest source code.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The original trim header update code was using blocking IO to
update the header. After migrating to an asynchronous trim
which performs all work in librados callbacks, it exposed a
potential deadlock in the librados_test_stub when attempting
to do blocking IO within a librados callback. This commit
changes the header update to use AIO.
Fixes: #10637
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The 'src/gmock' directory is extracted from the 1.7.0
release located at https://code.google.com/p/googlemock/
gmock is licensed under the New BSD license, see
src/gmock/LICENSE
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
On my box LC_ALL=C# includes the '#' in the value without
a space between C and '#' and things go completely bonkers.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Ensure that no more than one outstanding progress callback
is queued for notification. This will allow remote progress
updates to be sent at a rate in which all watch/notify
clients can support.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When image locking is enabled, snapshot create, resize, and
flatten are coordinated with the lock owner. Previously, if the
the lock owner changed during one of this operations, the
operation would fail. Now librbd will attempt to restart the
operation with the new lock owner (or become the owner itself).
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The resize, flatten, and snapshot maintenance operations now
use the new assert_lock feature to ensure that the current
client still owns the header lock when making changes.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The assert_locked operation can be combined with other
RADOS ops to prevent an update to a locked object when
the client doesn't own the lock. It will not attempt to
acquire the lock if the object is not currently locked.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When the exclusive lock feature is enabled, only a single client can
modify the image. As a result, certain maintenance activities
need to be proxied from the maintenance client to the active
leader.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Snapshot, flatten, and resize maintenance operations can now
be coordinated via the client holding the exclusive lock for the
image.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Resize and flatten now have async versions. The existing resize
and flatten operations now use the async versions internally. The
async operations will be used by the client holding the exclusive
lock when it receives maintenance requests from other clients.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The trim completion context was not properly invoked if the
image's exclusive lock was lost between issuing a librados call
and receiving its completion.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The parsing is sensitive to i18n and will fail if, for instance, it is set to French.
Workaround the problem by always setting the language to C so the script
can safely assume all output will be in english.
http://tracker.ceph.comm/issues/10596Fixes: #10596
Signed-off-by: Ahoussi Armand <ahoussi.say@telecom-bretagne.eu>
Use wildcard to capture gzipped man pages for ceph-clsinfo(8) and
librados-config(8). In addition to future-proofing us against
possible compression type changes down the road, this also aligns us
with the existing convention that's used to capture the rest of the man
page files.
The owner_lock was incorrectly held when unregistering the image
watcher. It was possible for the ImageWatcher finisher to be
running code that was then deadlocked waiting to acquire the
owner_lock while the close_image thread was attempting to shutdown
the deadlocked finisher.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
There was a rare race condition between a pending CoR operation
and a resize down operation resulting in a CoR copyup past the
new, reduced parent overlap. This commit also adds additional
log message details for CoR.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new RBD copy-on-read unit test case uses these RADOS functions
to verify that the CoR operation was successful. This implements
these functions in the librados_test_stub library.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When issuing the CoR copyup request, there is no need to keep
initialize the librados callback. Treat the CoR as a fire-and-
forget operation.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When the RBD cache is enabled, the ObjectCacher does not allow
reentrancy to read the full object. As a temporary workaround,
use the Finisher to handle CoR read requests.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
We left this off because it seemed the same as DONTNEED, but there is a
subtle distinction: DONTNEED means nobody will need it (and we probably
discard our cache), while NOREUSE means this client won't need it again
(and we should try to avoid polluting the cache from this IO only). At
least, that's the way we'r defining it. posix_fadvise says:
POSIX_FADV_NOREUSE
The specified data will be accessed only once.
POSIX_FADV_DONTNEED
The specified data will not be accessed in the near future.
which is similar. I think our definitions make a bit more sense for the
multi-client environment.
Signed-off-by: Sage Weil <sage@redhat.com>
If a librados watch error occurs, it is possible that one
or more events were missed. Therefore, flag the header as
dirty so that it will be reloaded after the next operation.
Fixes: #4092
Signed-off-by: Jason Dillaman <dillaman@redhat.com>