Supposed fix for "unexpected state during flush: 0x51" with EC

Vitaliy Filippov 2024-02-20 20:42:49 +03:00
parent 3d16cde23c
commit 3eb389b321
2 changed files with 37 additions and 23 deletions

View File

@ -307,7 +307,14 @@ int blockstore_impl_t::dequeue_stable(blockstore_op_t *op)
return STAB_SPLIT_DONE; return STAB_SPLIT_DONE;
} }
} }
else if (IS_IN_FLIGHT(dirty_it->second.state)) else if (IS_STABLE(dirty_it->second.state))
{
// Already stable
return STAB_SPLIT_DONE;
}
while (true)
{
if (IS_IN_FLIGHT(dirty_it->second.state))
{ {
// Object write is still in progress. Wait until the write request completes // Object write is still in progress. Wait until the write request completes
return STAB_SPLIT_WAIT; return STAB_SPLIT_WAIT;
@ -329,13 +336,20 @@ int blockstore_impl_t::dequeue_stable(blockstore_op_t *op)
} }
else if (IS_STABLE(dirty_it->second.state)) else if (IS_STABLE(dirty_it->second.state))
{ {
// Already stable break;
return STAB_SPLIT_DONE;
} }
else // Check previous versions too
if (dirty_it == dirty_db.begin())
{ {
return STAB_SPLIT_TODO; break;
} }
dirty_it--;
if (dirty_it->first.oid != ov.oid)
{
break;
}
}
return STAB_SPLIT_TODO;
}); });
if (r != 1) if (r != 1)
{ {

View File

@ -33,7 +33,7 @@ kill_osds()
for kill_osd in $(seq 2 $OSD_COUNT); do for kill_osd in $(seq 2 $OSD_COUNT); do
sleep 15 sleep 15
# Wait for all PGs to clear has_degraded - all data will be at least in 2 copies # Wait for all PGs to clear has_degraded - all data will be at least in 2 copies
wait_condition 60 "$ETCDCTL get /vitastor/pg/state/1/ --prefix --print-value-only |\ wait_condition 600 "$ETCDCTL get /vitastor/pg/state/1/ --prefix --print-value-only |\
jq -s -e '[ .[] | select(.state | contains(["'"'"active"'"'"])) | select(.state | contains(["'"'"has_degraded"'"'"]) | not) ] | length == '$PG_COUNT" jq -s -e '[ .[] | select(.state | contains(["'"'"active"'"'"])) | select(.state | contains(["'"'"has_degraded"'"'"]) | not) ] | length == '$PG_COUNT"
echo Killing OSD $kill_osd and starting OSD $((kill_osd-1)) echo Killing OSD $kill_osd and starting OSD $((kill_osd-1))
p=OSD${kill_osd}_PID p=OSD${kill_osd}_PID