Fix commented out //this->pg_state_dirty.insert
This commit is contained in:
+1
-1
@@ -347,7 +347,7 @@ class osd_t
|
|||||||
bool check_write_queue(osd_op_t *cur_op, pg_t & pg);
|
bool check_write_queue(osd_op_t *cur_op, pg_t & pg);
|
||||||
pg_osd_set_state_t* add_object_to_set(pg_t & pg, const object_id oid, const pg_osd_set_t & osd_set,
|
pg_osd_set_state_t* add_object_to_set(pg_t & pg, const object_id oid, const pg_osd_set_t & osd_set,
|
||||||
uint64_t old_pg_state, int log_at_level);
|
uint64_t old_pg_state, int log_at_level);
|
||||||
void remove_object_from_state(object_id & oid, pg_osd_set_state_t **object_state, pg_t &pg, bool report = true);
|
bool remove_object_from_state(object_id & oid, pg_osd_set_state_t **object_state, pg_t &pg, bool report = true);
|
||||||
pg_osd_set_state_t *mark_object(pg_t & pg, object_id oid, pg_osd_set_state_t *prev_object_state, bool ref,
|
pg_osd_set_state_t *mark_object(pg_t & pg, object_id oid, pg_osd_set_state_t *prev_object_state, bool ref,
|
||||||
std::function<int(pg_osd_set_t & new_set)> calc_set);
|
std::function<int(pg_osd_set_t & new_set)> calc_set);
|
||||||
pg_osd_set_state_t *mark_object_corrupted(pg_t & pg, object_id oid, pg_osd_set_state_t *prev_object_state,
|
pg_osd_set_state_t *mark_object_corrupted(pg_t & pg, object_id oid, pg_osd_set_state_t *prev_object_state,
|
||||||
|
|||||||
@@ -604,11 +604,11 @@ pg_osd_set_state_t* osd_t::add_object_to_set(pg_t & pg, const object_id oid, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Decrement pg_osd_set_state_t's object_count and change PG state accordingly
|
// Decrement pg_osd_set_state_t's object_count and change PG state accordingly
|
||||||
void osd_t::remove_object_from_state(object_id & oid, pg_osd_set_state_t **object_state, pg_t & pg, bool report)
|
bool osd_t::remove_object_from_state(object_id & oid, pg_osd_set_state_t **object_state, pg_t & pg, bool report)
|
||||||
{
|
{
|
||||||
if (!*object_state)
|
if (!*object_state)
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
pg_osd_set_state_t *recheck_state = NULL;
|
pg_osd_set_state_t *recheck_state = NULL;
|
||||||
get_object_osd_set(pg, oid, &recheck_state);
|
get_object_osd_set(pg, oid, &recheck_state);
|
||||||
@@ -617,7 +617,7 @@ void osd_t::remove_object_from_state(object_id & oid, pg_osd_set_state_t **objec
|
|||||||
recheck_state->ref_count++;
|
recheck_state->ref_count++;
|
||||||
(*object_state)->ref_count--;
|
(*object_state)->ref_count--;
|
||||||
*object_state = recheck_state;
|
*object_state = recheck_state;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
(*object_state)->object_count--;
|
(*object_state)->object_count--;
|
||||||
@@ -692,6 +692,7 @@ void osd_t::remove_object_from_state(object_id & oid, pg_osd_set_state_t **objec
|
|||||||
{
|
{
|
||||||
report_pg_state(pg);
|
report_pg_state(pg);
|
||||||
}
|
}
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void osd_t::deref_object_state(pg_t & pg, pg_osd_set_state_t **object_state, bool deref)
|
void osd_t::deref_object_state(pg_t & pg, pg_osd_set_state_t **object_state, bool deref)
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ resume_12:
|
|||||||
{
|
{
|
||||||
// Any kind of a non-clean object can have extra chunks, because we don't record objects
|
// Any kind of a non-clean object can have extra chunks, because we don't record objects
|
||||||
// as degraded & misplaced or incomplete & misplaced at the same time. So try to remove extra chunks
|
// as degraded & misplaced or incomplete & misplaced at the same time. So try to remove extra chunks
|
||||||
|
bool changed = false;
|
||||||
if (immediate_commit != IMMEDIATE_ALL)
|
if (immediate_commit != IMMEDIATE_ALL)
|
||||||
{
|
{
|
||||||
// We can't remove extra chunks yet if fsyncs are explicit, because
|
// We can't remove extra chunks yet if fsyncs are explicit, because
|
||||||
@@ -303,13 +304,21 @@ resume_12:
|
|||||||
{
|
{
|
||||||
// PG can't be active+clean until extra copies aren't removed, so mark it as PG_HAS_MISPLACED
|
// PG can't be active+clean until extra copies aren't removed, so mark it as PG_HAS_MISPLACED
|
||||||
pg.state |= PG_HAS_MISPLACED;
|
pg.state |= PG_HAS_MISPLACED;
|
||||||
//this->pg_state_dirty.insert({ .pool_id = pg.pool_id, .pg_num = pg.pg_num });
|
changed = true;
|
||||||
|
this->pg_state_dirty.insert({ .pool_id = pg.pool_id, .pg_num = pg.pg_num });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// We must forget the unclean state of the object before deleting it
|
// We must forget the unclean state of the object before deleting it
|
||||||
// so the next reads don't accidentally read a deleted version
|
// so the next reads don't accidentally read a deleted version
|
||||||
// And it should be done at the same time as the removal of the version override
|
// And it should be done at the same time as the removal of the version override
|
||||||
remove_object_from_state(op_data->oid, &op_data->object_state, pg);
|
if (remove_object_from_state(op_data->oid, &op_data->object_state, pg, false))
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
report_pg_state(pg);
|
||||||
|
}
|
||||||
pg.clean_count++;
|
pg.clean_count++;
|
||||||
}
|
}
|
||||||
resume_6:
|
resume_6:
|
||||||
|
|||||||
Reference in New Issue
Block a user