Skip to content

Commit 7ef7a13

Browse files
committed
mon/OSDMonitor: always create pgs in the epoch in which the pool was created
The logic here didn't actually work. If update_pending_pgs doesn't get to a particular PG (because of mon_osd_max_creating_pgs limitation) in the epoch in which the pool was created, the pg will end up with a same_interval_since at that epoch rather than the pool creation epoch. This can cause an IO submitted by a client based on the epoch in which the pool was created to be rejected by the OSD without an interval change actually occuring and therefore without the client resending the op. In order to make this limit actually function, once we actually process a pending pg, we'd have to go back to the OSDMap at which the pool was created and work forward to get the correct interval bound. That seems even more expensive, so instead this patch simply removes the limit. Fixes: https://tracker.ceph.com/issues/64546 Signed-off-by: Samuel Just <[email protected]>
1 parent 2af3616 commit 7ef7a13

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

src/common/options/mon.yaml.in

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,6 @@ options:
12491249
services:
12501250
- mon
12511251
with_legacy: true
1252-
- name: mon_osd_max_creating_pgs
1253-
type: int
1254-
level: advanced
1255-
desc: maximum number of PGs the mon will create at once
1256-
default: 1024
1257-
services:
1258-
- mon
1259-
with_legacy: true
12601252
- name: mon_osd_max_initial_pgs
12611253
type: int
12621254
level: advanced

src/mon/OSDMonitor.cc

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,32 +1251,25 @@ OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc,
12511251
}
12521252

12531253
// process queue
1254-
unsigned max = std::max<int64_t>(1, g_conf()->mon_osd_max_creating_pgs);
12551254
const auto total = pending_creatings.pgs.size();
1256-
while (pending_creatings.pgs.size() < max &&
1257-
!pending_creatings.queue.empty()) {
1255+
while (!pending_creatings.queue.empty()) {
12581256
auto p = pending_creatings.queue.begin();
12591257
int64_t poolid = p->first;
12601258
dout(10) << __func__ << " pool " << poolid
12611259
<< " created " << p->second.created
12621260
<< " modified " << p->second.modified
12631261
<< " [" << p->second.start << "-" << p->second.end << ")"
12641262
<< dendl;
1265-
int64_t n = std::min<int64_t>(max - pending_creatings.pgs.size(),
1266-
p->second.end - p->second.start);
1267-
ps_t first = p->second.start;
1268-
ps_t end = first + n;
1269-
for (ps_t ps = first; ps < end; ++ps) {
1263+
for (ps_t ps = p->second.start; ps < p->second.end; ++ps) {
12701264
const pg_t pgid{ps, static_cast<uint64_t>(poolid)};
1271-
// NOTE: use the *current* epoch as the PG creation epoch so that the
1272-
// OSD does not have to generate a long set of PastIntervals.
1265+
// The current epoch must be the pool creation epoch
12731266
pending_creatings.pgs.emplace(
12741267
pgid,
1275-
creating_pgs_t::pg_create_info(inc.epoch,
1268+
creating_pgs_t::pg_create_info(p->second.created,
12761269
p->second.modified));
12771270
dout(10) << __func__ << " adding " << pgid << dendl;
12781271
}
1279-
p->second.start = end;
1272+
p->second.start = p->second.end;
12801273
if (p->second.done()) {
12811274
dout(10) << __func__ << " done with queue for " << poolid << dendl;
12821275
pending_creatings.queue.erase(p);

0 commit comments

Comments
 (0)