Skip to content

Commit 175e684

Browse files
committed
osd: Create a new interval when the optimization flag gets switch on.
This allows for the old EC code to cleanly shutdown using the on_change notification. The new code can then start up cleanly. Signed-off-by: Alex Ainscow <[email protected]>
1 parent 6eac155 commit 175e684

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

src/osd/osd_types.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4199,6 +4199,8 @@ bool PastIntervals::is_new_interval(
41994199
uint32_t new_crush_barrier,
42004200
int32_t old_crush_member,
42014201
int32_t new_crush_member,
4202+
bool old_allow_ec_optimizations,
4203+
bool new_allow_ec_optimizations,
42024204
pg_t pgid) {
42034205
return old_acting_primary != new_acting_primary ||
42044206
new_acting != old_acting ||
@@ -4222,7 +4224,8 @@ bool PastIntervals::is_new_interval(
42224224
old_crush_count != new_crush_count ||
42234225
old_crush_target != new_crush_target ||
42244226
old_crush_barrier != new_crush_barrier ||
4225-
old_crush_member != new_crush_member;
4227+
old_crush_member != new_crush_member ||
4228+
old_allow_ec_optimizations != new_allow_ec_optimizations;
42264229
}
42274230

42284231
bool PastIntervals::is_new_interval(
@@ -4271,6 +4274,7 @@ bool PastIntervals::is_new_interval(
42714274
plast->peering_crush_bucket_target, pi->peering_crush_bucket_target,
42724275
plast->peering_crush_bucket_barrier, pi->peering_crush_bucket_barrier,
42734276
plast->peering_crush_mandatory_member, pi->peering_crush_mandatory_member,
4277+
plast->allows_ecoptimizations(), pi->allows_ecoptimizations(),
42744278
pgid);
42754279
}
42764280

src/osd/osd_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,6 +3461,8 @@ class PastIntervals {
34613461
uint32_t new_crush_barrier,
34623462
int32_t old_crush_member,
34633463
int32_t new_crush_member,
3464+
bool old_allow_ec_optimizations,
3465+
bool new_allow_ec_optimizations,
34643466
pg_t pgid
34653467
);
34663468

src/osdc/Objecter.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,6 +2934,8 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
29342934
pi->peering_crush_bucket_barrier,
29352935
t->peering_crush_mandatory_member,
29362936
pi->peering_crush_mandatory_member,
2937+
t->allows_ecoptimizations,
2938+
pi->allows_ecoptimizations(),
29372939
prev_pgid)) {
29382940
force_resend = true;
29392941
}
@@ -2989,6 +2991,7 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
29892991
t->peering_crush_bucket_target = pi->peering_crush_bucket_target;
29902992
t->peering_crush_bucket_barrier = pi->peering_crush_bucket_barrier;
29912993
t->peering_crush_mandatory_member = pi->peering_crush_mandatory_member;
2994+
t->allows_ecoptimizations = pi->allows_ecoptimizations();
29922995
ldout(cct, 10) << __func__ << " "
29932996
<< " raw pgid " << pgid << " -> actual " << t->actual_pgid
29942997
<< " acting " << t->acting

src/osdc/Objecter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {
18561856
int min_size = -1; ///< the min size of the pool when were were last mapped
18571857
bool sort_bitwise = false; ///< whether the hobject_t sort order is bitwise
18581858
bool recovery_deletes = false; ///< whether the deletes are performed during recovery instead of peering
1859+
bool allows_ecoptimizations = false; ///< whether EC plugin optimizations are enabled.
18591860
uint32_t peering_crush_bucket_count = 0;
18601861
uint32_t peering_crush_bucket_target = 0;
18611862
uint32_t peering_crush_bucket_barrier = 0;

0 commit comments

Comments
 (0)