diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 5a36da938325..d556f7233545 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -6227,6 +6227,7 @@ mod tests { let cancel = CancellationToken::new(); let base_key = Key::from_hex("620000000033333333444444445500000000").unwrap(); + assert_eq!(base_key.field1, AUX_KEY_PREFIX); // in case someone accidentally changed the prefix... let mut test_key = base_key; let mut lsn = Lsn(0x10); diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index bdaa55c880f8..28627e79117c 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -427,9 +427,12 @@ pub struct Timeline { /// Indicate whether aux file v2 storage is enabled. pub(crate) last_aux_file_policy: AtomicAuxFilePolicy, - #[cfg(test)] /// Some test cases directly place keys into the timeline without actually modifying the directory - /// keys (i.e., DB_DIR). Test cases will put such keyspaces here. + /// keys (i.e., DB_DIR). The test cases creating such keys will put the keyspaces here, so that + /// these keys won't get garbage-collected during compaction/GC. This field only modifies the dense + /// keyspace return value of `collect_keyspace`. For sparse keyspaces, use AUX keys for testing, and + /// in the future, add `extra_test_sparse_keyspace` if necessary. + #[cfg(test)] pub(crate) extra_test_dense_keyspace: ArcSwap, }