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/ECBackend: Send write message to peers first, then do local write #12522

Merged
merged 1 commit into from Dec 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/osd/ECBackend.cc
Expand Up @@ -1884,7 +1884,8 @@ bool ECBackend::try_reads_to_commit()

dout(10) << "onreadable_sync: " << op->on_local_applied_sync << dendl;
ObjectStore::Transaction empty;

bool should_write_local = false;
ECSubWrite local_write_op;
for (set<pg_shard_t>::const_iterator i =
get_parent()->get_actingbackfill_shards().begin();
i != get_parent()->get_actingbackfill_shards().end();
Expand Down Expand Up @@ -1916,12 +1917,8 @@ bool ECBackend::try_reads_to_commit()
op->temp_cleared,
!should_send);
if (*i == get_parent()->whoami_shard()) {
handle_sub_write(
get_parent()->whoami_shard(),
op->client_op,
sop,
op->on_local_applied_sync);
op->on_local_applied_sync = 0;
should_write_local = true;
local_write_op.claim(sop);
} else {
MOSDECSubOpWrite *r = new MOSDECSubOpWrite(sop);
r->pgid = spg_t(get_parent()->primary_spg_t().pgid, i->shard);
Expand All @@ -1930,6 +1927,14 @@ bool ECBackend::try_reads_to_commit()
i->osd, r, get_parent()->get_epoch());
}
}
if (should_write_local) {
handle_sub_write(
get_parent()->whoami_shard(),
op->client_op,
local_write_op,
op->on_local_applied_sync);
op->on_local_applied_sync = 0;
}

for (auto i = op->on_write.begin();
i != op->on_write.end();
Expand Down