From f7249b9018d582cb2b03546836e04f44fbb03644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Sat, 11 Nov 2023 01:32:00 +0100 Subject: [PATCH] Fix comment in find_lsn_for_timestamp (#5855) We still subtract 1 from low to compute `commit_lsn`. the comment moved/added by #5844 should point this out. --- pageserver/src/pgdatadir_mapping.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pageserver/src/pgdatadir_mapping.rs b/pageserver/src/pgdatadir_mapping.rs index abdb4a8379..827278af72 100644 --- a/pageserver/src/pgdatadir_mapping.rs +++ b/pageserver/src/pgdatadir_mapping.rs @@ -402,8 +402,9 @@ impl Timeline { low = mid + 1; } } - // If `found_smaller == true`, `low` is the LSN of the last commit record - // before or at `search_timestamp` + // If `found_smaller == true`, `low = t + 1` where `t` is the target LSN, + // so the LSN of the last commit record before or at `search_timestamp`. + // Remove one from `low` to get `t`. // // FIXME: it would be better to get the LSN of the previous commit. // Otherwise, if you restore to the returned LSN, the database will