Skip to content

Commit

Permalink
refactor(pageserver): refactor split writers using batch layer writer (
Browse files Browse the repository at this point in the history
…#9493)

part of #9114,
#8836,
#8362

The split layer writer code can be used in a more general way: the
caller puts unfinished writers into the batch layer writer and let batch
layer writer to ensure the atomicity of the layer produces.

## Summary of changes

* Add batch layer writer, which atomically finishes the layers.
`BatchLayerWriter::finish` is simply a copy-paste from previous split
layer writers.
* Refactor split writers to use the batch layer writer.
* The current split writer tests cover all code path of batch layer
writer.

---------

Signed-off-by: Alex Chi Z <[email protected]>
  • Loading branch information
skyzh authored Oct 24, 2024
1 parent b8a3111 commit fb0406e
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 140 deletions.
2 changes: 1 addition & 1 deletion pageserver/src/tenant/storage_layer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Common traits and structs for layers
pub mod batch_split_writer;
pub mod delta_layer;
pub mod filter_iterator;
pub mod image_layer;
Expand All @@ -8,7 +9,6 @@ pub(crate) mod layer;
mod layer_desc;
mod layer_name;
pub mod merge_iterator;
pub mod split_writer;

use crate::context::{AccessStatsBehavior, RequestContext};
use crate::repository::Value;
Expand Down
Loading

1 comment on commit fb0406e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5238 tests run: 5023 passed, 1 failed, 214 skipped (full report)


Failures on Postgres 17

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_readonly_node_gc[debug-pg17]"

Test coverage report is not available

The comment gets automatically updated with the latest test results
fb0406e at 2024-10-24T15:40:54.309Z :recycle:

Please sign in to comment.