Skip to content

Conversation

@gabrielbornstein
Copy link

No description provided.

conanfile.py Outdated
self.requires("llfs/0.42.0", **VISIBLE)
self.requires("pcg-cpp/cci.20220409", **VISIBLE)
self.requires("vqf/0.2.5", **VISIBLE)
self.requires("vqf/0.2.5-devel", **VISIBLE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert, as discussed.

Copy link
Author

Choose a reason for hiding this comment

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

Done

std::shared_ptr<const TreeView> tree,
TreeView::from_page(
checkpoint_volume.cache().get_page(tree_root_id, llfs::OkIfNotFound{false})));
// TODO: [Gabe Bornstein 11/4/25] Consider, error handling for invalid checkpoint
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe include some of the things to check, e.g. that the batch id is in the valid range.

Copy link
Author

Choose a reason for hiding this comment

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

Now checking that batch_upper_bound is non-zero


Subtree tree = Subtree::from_page_id(tree_root_id);

batt::StatusOr<i32> height = tree.get_height(*(checkpoint_volume.new_job()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's cheaper/better to call tree.get_height(checkpoint_volume.cache()) here.

Copy link
Author

Choose a reason for hiding this comment

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

Done

llfs::Volume& checkpoint_volume,
const llfs::SlotWithPayload<TabletCheckpoint>& checkpoint) noexcept;
#endif
static StatusOr<Checkpoint> recover(llfs::Volume& checkpoint_volume,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add doc comment.

Copy link
Author

Choose a reason for hiding this comment

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

Done

return OkStatus();
}

using CheckpointSlotPairs = std::vector<std::pair<llfs::SlotParse, turtle_kv::PackedCheckpoint>>;
Copy link
Collaborator

@tonyastolfi tonyastolfi Nov 18, 2025

Choose a reason for hiding this comment

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

Suggest either remove this indirection, or maybe append Vec to make readability better. Or consider replacing std::pair with a struct type.

Copy link
Author

Choose a reason for hiding this comment

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

Restructured these functions and eliminated this type indirection


//==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - -
//
batt::StatusOr<CheckpointSlotPairs> recover_packed_checkpoints(llfs::Volume& volume)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider changing to something like StatusOr<PackedCheckpoint> recover_latest_packed_checkpoint, since we seem only to need the latest one anyhow.

Copy link
Author

Choose a reason for hiding this comment

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

Compacted these two functions into a single function

@gabrielbornstein
Copy link
Author

Ready for another round of review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants