Commit Graph

51721 Commits

Author SHA1 Message Date
Jason Dillaman
668b41d1e8 librbd: track mirror peer replay state
This new state will protect against the case of an rbd-mirror crash
between registering with the remote and starting the image sync.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
276e2eb21b rbd-mirror: allocate local journal tags from mirror remote peer tags
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
bdee02cb57 journal: helper method for retrieving tag struct
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
4adc57ecfb rbd: use consistent "non-primary" verbiage for image mirroring
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
04892961d2 librbd: image demotion should record new demote journal event
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
970a17368a librbd: blacklist journal error while attempting to acquire lock
The journal policy will return -EPERM if attempting to acquire the
exclusive lock when the image is non-primary.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
e1c61f59ae librbd: new demote journal event
This event will be used as a placeholder to ensure that the demotion journal
tag is properly processed by rbd-mirror.  Without an event associated with
the demotion journal tag, the demotion event will be missed.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
f42e7610fb rbd-mirror: framework for replay allocating tags in local journal
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
5de360dd64 librbd: journal reset should re-register the local client
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
d624e65a30 rbd-mirror: cleanup debug log messages
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
476da1011c rbd-mirror: cross-reference local image via global image id
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
909eb43d73 cls_rbd: mirroring directory reverse lookup from global id to image id
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
347349c3f5 rbd-mirror: bootstrap requires the global image id
The global image id can be used to cross-reference images that
have been replicated amongst peers.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
6541e3566a rbd-mirror: fix state output stream formatter
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
7a3ffc9d70 librbd: support creating images with non-primary journals
When rbd-mirror initially creates a replicated image in the
local pool, the journal should be flagged as non-primary to
(1) prevent local ops againsts the image and (2) provide a
clean chain of replicated tags.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:19:25 -04:00
Jason Dillaman
f01efc8ce6 rbd-mirror: don't acquire lock for primary local images
Abort the image replay for any local images that are marked as primary.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
511039eca9 rbd-mirror: tweaks to support creating mock test cases
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
8e8deb35a2 rbd-mirror: bootstrap now has initial support for existing images
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
d9ee1e7270 rbd-mirror: properly initialize image copy start/end objects
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
18e849f01c rbd-mirror: only delete ImageCtx after open failure
The image is already closed -- it just needs to be destroyed
in a thread context outside of librbd.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
cb72ac120c cls_journal: disallow client registration against missing journal
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
0b0b2244a0 journal: added helper to query single client record from disk
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
418b4746a1 rbd-mirror: convert ImageReplayer into templated class
This will facilitate create mock test cases.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
7d10eb01c0 librbd: helper methods to allocate tags associated to remote journals
Allocating tags for the local journal will always be based off the local
commit position.  For remote journals, the local commit position doesn't
reflect actual events replayed by rbd-mirror, so it needs to provide the
remote journal commit position.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
0f99d88dc9 rbd-mirror: initial integration with librbd lock/journal policies
For the first stage, acquiring the exclusive-lock will no longer
automatically result in the allocation of a journal tag.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:29 -04:00
Jason Dillaman
a9549d6643 librbd: basic policy for journal handling
This will allow rbd-mirror to override the allocation of a new
tag and to restart rbd-mirror's image replayer when a watch error
forces the loss of the exclusive lock.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:28 -04:00
Jason Dillaman
38cf63d55c librbd: optional 'force' parameter for request lock payload
This will be used when force promoting an image to primary -- when
rbd-mirror receives the forced request, it will immediately abort
playback.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:28 -04:00
Jason Dillaman
2afb2c31ed librbd: basic policy for controlling the release of the exclusive lock
The rbd-mirror daemon will need to interlock with the request for the lock
from another client with the successful sync of remote journal events.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:28 -04:00
Jason Dillaman
dae789dd2b librbd: journal type traits should be standalone
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:27 -04:00
Jason Dillaman
e94e779edb Merge pull request #8332 from rjfd/wip-15267
rbd-mirror: prevent enabling/disabling an image's mirroring when not in image mode

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2016-03-29 15:12:09 -04:00
Sage Weil
88a183bd85 Merge remote-tracking branch 'gh/jewel' 2016-03-29 15:04:16 -04:00
Sage Weil
eff3b08a75 Merge pull request #8320 from dachary/wip-virtualenv-jewel
Makefile-env.am: set a default for CEPH_BUILD_VIRTUALENV (part 2)

Reviewed-by: Dan Mick <dmick@redhat.com>
2016-03-29 15:08:54 -04:00
Sage Weil
962c65a48d Merge pull request #8360 from jdurgin/wip-ceph-python-path
ceph.in: correct dev python path for automake builds

Tested-by: Sage Weil <sage@redhat.com>
2016-03-29 15:06:56 -04:00
Josh Durgin
c321c534e4 Merge pull request #8361 from liewegas/wip-test-port
test/test_pool_create.sh: fix port

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-03-29 11:34:54 -07:00
Josh Durgin
ef179eddde Merge remote-tracking branch 'origin/jewel' 2016-03-29 11:33:02 -07:00
Josh Durgin
5878c8ce9d Merge pull request #8356 from ceph/wip-cython-build-dir
pybind/Makefile.am: Prevent race creating CYTHON_BUILD_DIR

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2016-03-29 11:27:10 -07:00
Sage Weil
a21cc54b98 test/test_pool_create.sh: fix port
17108 is used by test/mon/test_pool_quota.sh

Signed-off-by: Sage Weil <sage@redhat.com>
2016-03-29 14:26:17 -04:00
Sage Weil
fc7942bfd0 Merge pull request #8359 from athanatos/wip-15205
os/ObjectStore: try_move_rename in transaction append and add coverage to store_test

Reviewed-by: Sage Weil <sage@redhat.com>
2016-03-29 14:22:51 -04:00
Josh Durgin
a041e5c941 ceph.in: correct dev python path for automake builds
Accidentally broken by ad2e6f442d

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2016-03-29 11:18:26 -07:00
Samuel Just
9d6de8484b store_test: apply an appended transaction half the time
Signed-off-by: Samuel Just <sjust@redhat.com>
2016-03-29 11:13:53 -07:00
Samuel Just
5bf281e92c Transaction: handle OP_TRY_RENAME in dump
Signed-off-by: Samuel Just <sjust@redhat.com>
2016-03-29 11:13:53 -07:00
Samuel Just
9634cec809 store_test: add a TryMoveRename test
Signed-off-by: Samuel Just <sjust@redhat.com>
2016-03-29 11:13:52 -07:00
Samuel Just
eb9e80c94f ObjectStore::Transaction::_update_op: handle OP_TRY_RENAME
Fixes: http://tracker.ceph.com/issues/15205
Signed-off-by: Samuel Just <sjust@redhat.com>
2016-03-29 11:13:35 -07:00
Ricardo Dias
f3ebe4661a rbd: rbd-mirroring: Updated rbd mirroring unit tests to reflect the new conditions to enable/disable image mirroring
Signed-off-by: Ricardo Dias <rdias@suse.com>
2016-03-29 19:05:58 +01:00
Samuel Just
d2beb77760 Merge pull request #6317 from cxwshawn/wip-lost-fix
PG: pg down state blocked by osd.x, lost osd.x cannot solve peering stuck

Reviewed-by: Samuel Just <sjust@redhat.com>
2016-03-29 10:56:55 -07:00
Sage Weil
c40d90df06 Merge pull request #8292 from vshankar/bluefs-tool-fix
os/bluestore: ceph-bluefs-tool fixes

Reviewed-by: Sage Weil <sage@redhat.com>
2016-03-29 13:47:26 -04:00
branto1
8a83ec9904 Merge pull request #8334 from dachary/wip-subman-facts
script: subscription-manager support (part 3)

Reviewed-by: Boris Ranto <branto@redhat.com>
2016-03-29 19:37:02 +02:00
Orit Wasserman
48a823b359 Merge pull request #8351 from jcsp/wip-cmake-cython
cmake: Build cython modules and change paths to bin/, lib/
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2016-03-29 18:35:22 +02:00
Ricardo Dias
872b1b1cdc rbd: rbd-mirroring: Disable image mirroring depends on pool mirroring mode
Signed-off-by: Ricardo Dias <rdias@suse.com>
Fixes: #15267
2016-03-29 17:26:53 +01:00
Ricardo Dias
bc254c851c rbd: rbd-mirroring: Enabling image mirroring depends on pool mirroring mode
Signed-off-by: Ricardo Dias <rdias@suse.com>
2016-03-29 17:26:53 +01:00