diff options
author | Samuel Just <sam.just@inktank.com> | 2013-09-24 22:47:36 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-09-26 11:24:29 -0700 |
commit | a1f6b14e7fcd680f74a33e92845e54cbde69a5a3 (patch) | |
tree | 0ba59f0d435218ecb057888184905f96d6e8a739 | |
parent | b29ac2ad87a7b1983a491903540d1c19b852a0af (diff) | |
download | ceph-a1f6b14e7fcd680f74a33e92845e54cbde69a5a3.tar.gz |
ReplicatedPG: take obc read lock prior to recovering an object to replicas
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index fe22b22e2cb..191e7deb77a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7821,11 +7821,19 @@ int ReplicatedPG::prep_object_replica_pushes( start_recovery_op(soid); assert(!recovering.count(soid)); recovering.insert(soid); + + /* We need this in case there is an in progress write on the object. In fact, + * the only possible write is an update to the xattr due to a lost_revert -- + * a client write would be blocked since the object is degraded. + * In almost all cases, therefore, this lock should be uncontended. + */ + obc->ondisk_read_lock(); pgbackend->recover_object( soid, ObjectContextRef(), obc, // has snapset context h); + obc->ondisk_read_unlock(); return 1; } |