You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If compaction fails (i.e., running out of space), the temporary files generated will be left on disk, and therefore they will not be removed and occupy the space. We should remove them if compaction fails.
good_first_issue Initial implementation ideas
test_runner/regress/test_duplicate_layers.py::test_actually_duplicated_l1 creates a similar situation as what this issue is after fixing but instead of exiting pageserver after first image layer has been written out, we want to return an error and have all the layers which have not made it to layermap be deleted when exiting the scope. This is not currently implemented, and the way the pageserver::tenant::storage_layer::Layer is implemented right now is too deep in the DeltaLayerWriter. If the rename would happen later, we would have no problem.
The needed structure is not however trivial, because assuming we have new compacted layers ls which has more than 1 layer. After we rename 1 element to have it's final path, that final path might still need to be deleted in case any of the renames later fail.
This will most likely require changing pageserver::tenant::storage_layer::Layer::finish_creating or at least the outer procedure of "how to get final named paths become layers while creating compacted layers." My initial idea was to instead of having DeltaLayerWriter create the individual Layer values, have it create something like UnfinishedLayer which has the ability of being renamed from temporary file to actual path, but will retain the tempfile alike "delete on drop" until finally moved out to be an actual Layer which gets added to LayerMap.
There is quite the risk of becoming a badly reviewed external contributor PR because this is so open, so not yet adding that label.
The text was updated successfully, but these errors were encountered:
While reviewing code noticed a scary `layer_paths.pop().unwrap()` then
realized this should be further asyncified, something I forgot to do
when I switched the `compact_level0_phase1` back to async in #4938.
This keeps the double-fsync for new deltas as #4749 is still unsolved.
If compaction fails (i.e., running out of space), the temporary files generated will be left on disk, and therefore they will not be removed and occupy the space. We should remove them if compaction fails.
good_first_issueInitial implementation ideastest_runner/regress/test_duplicate_layers.py::test_actually_duplicated_l1
creates a similar situation as what this issue is after fixing but instead of exiting pageserver after first image layer has been written out, we want to return an error and have all the layers which have not made it to layermap be deleted when exiting the scope. This is not currently implemented, and the way thepageserver::tenant::storage_layer::Layer
is implemented right now is too deep in theDeltaLayerWriter
. If the rename would happen later, we would have no problem.The needed structure is not however trivial, because assuming we have new compacted layers
ls
which has more than 1 layer. After we rename 1 element to have it's final path, that final path might still need to be deleted in case any of the renames later fail.This will most likely require changing
pageserver::tenant::storage_layer::Layer::finish_creating
or at least the outer procedure of "how to get final named paths become layers while creating compacted layers." My initial idea was to instead of havingDeltaLayerWriter
create the individualLayer
values, have it create something likeUnfinishedLayer
which has the ability of being renamed from temporary file to actual path, but will retain the tempfile alike "delete on drop" until finally moved out to be an actual Layer which gets added to LayerMap.There is quite the risk of becoming a badly reviewed external contributor PR because this is so open, so not yet adding that label.
The text was updated successfully, but these errors were encountered: