wangyong9999 commented on code in PR #302:
URL: https://github.com/apache/paimon-cpp/pull/302#discussion_r3958623028
##########
src/paimon/core/manifest/snapshot_live_manifest_entries.h:
##########
@@ -38,17 +39,26 @@ class MemorySegment;
///
/// This value object owns merged live manifest entries by snapshot id. It
does not own or access a
/// cache; callers are responsible for storing the serialized bytes in the
cache layer.
+///
+/// A snapshot id alone does not identify a snapshot: after a rollback, or
after a table is dropped
+/// and recreated at the same path, later commits reuse the ids of the deleted
snapshots. Every
+/// cached snapshot therefore also records the delta manifest list it was
built from, whose name is
+/// unique per commit, and `Find()` only reports a hit when both match.
class SnapshotLiveManifestEntries {
public:
struct Entry {
int64_t snapshot_id;
+ std::string delta_manifest_list;
std::shared_ptr<const std::vector<ManifestEntry>> entries;
};
explicit SnapshotLiveManifestEntries(int32_t max_snapshots);
std::optional<Entry> LatestBeforeOrEqual(int64_t snapshot_id) const;
Review Comment:
After this change nothing outside the tests calls `LatestBeforeOrEqual()`,
and it is the id-only lookup that produced the stale hit in the first place.
Unless an incremental rebuild from an older cached snapshot is planned, drop it
in this PR; the eviction checks in the tests can go through `Find()` and
`Size()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]