Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd/ReplicatedBackend: take read locks for clone sources during recovery #12844

Merged
merged 1 commit into from
Jan 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/osd/PGBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
const hobject_t &hoid,
map<string, bufferlist> &attrs) = 0;

virtual bool try_lock_for_read(
const hobject_t &hoid,
ObcLockManager &manager) = 0;

virtual void release_locks(ObcLockManager &manager) = 0;

virtual void op_applied(
const eversion_t &applied_version) = 0;

Expand Down
16 changes: 15 additions & 1 deletion src/osd/PrimaryLogPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,26 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
const pg_pool_t &get_pool() const override {
return pool.info;
}

ObjectContextRef get_obc(
const hobject_t &hoid,
map<string, bufferlist> &attrs) override {
return get_object_context(hoid, true, &attrs);
}

bool try_lock_for_read(
const hobject_t &hoid,
ObcLockManager &manager) override {
auto obc = get_object_context(hoid, false, nullptr);
if (!obc)
return false;
return manager.try_get_read_lock(hoid, obc);
}

void release_locks(ObcLockManager &manager) {
release_object_locks(manager);
}

void pgb_set_object_snap_mapping(
const hobject_t &soid,
const set<snapid_t> &snaps,
Expand All @@ -352,7 +367,6 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
return clear_object_snap_mapping(t, soid);
}


void log_operation(
const vector<pg_log_entry_t> &logv,
boost::optional<pg_hit_set_history_t> &hset_history,
Expand Down
Loading