Make deletions instantly stable
"2-phase" (write->stabilize) process is pointless for deletions because it doesn't protect us from incomplete objects. This happens because it removes the version information from metadata after stabilization. Deletions require "3-phase" process with a potentially very long 3rd phase. So, deletions will be allowed to generate degraded and incomplete objects, and for it to not affect users' ability to delete something, the cluster will allow to delete whole inodes while storing a list of them in etcd. Proper TRIM will be impossible until the implementation of the aforementioned "3-phase" process, though. By the way, this change also fixes a possible write stall after rebalancing which was caused by the lack of "stabilize delete" operations.
This commit is contained in:
+10
-1
@@ -275,7 +275,16 @@ void blockstore_impl_t::ack_one_sync(blockstore_op_t *op)
|
||||
#endif
|
||||
auto & unstab = unstable_writes[it->oid];
|
||||
unstab = unstab < it->version ? it->version : unstab;
|
||||
dirty_db[*it].state = dirty_db[*it].state == ST_DEL_WRITTEN ? ST_DEL_SYNCED : ST_J_SYNCED;
|
||||
if (dirty_db[*it].state == ST_DEL_WRITTEN)
|
||||
{
|
||||
dirty_db[*it].state = ST_DEL_SYNCED;
|
||||
// Deletions are treated as immediately stable
|
||||
mark_stable(*it);
|
||||
}
|
||||
else /* == ST_J_WRITTEN */
|
||||
{
|
||||
dirty_db[*it].state = ST_J_SYNCED;
|
||||
}
|
||||
}
|
||||
in_progress_syncs.erase(PRIV(op)->in_progress_ptr);
|
||||
op->retval = 0;
|
||||
|
||||
Reference in New Issue
Block a user