File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pub struct CompactedSegmentDataHeader {
2323 pub ( crate ) size_after : lu32 ,
2424 /// for now, always 4096
2525 pub ( crate ) page_size : lu16 ,
26+ pub ( crate ) timestamp : lu64 ,
2627}
2728impl CompactedSegmentDataHeader {
2829 fn check ( & self ) -> Result < ( ) > {
Original file line number Diff line number Diff line change 9494 version : LIBSQL_WAL_VERSION . into ( ) ,
9595 magic : LIBSQL_MAGIC . into ( ) ,
9696 page_size : self . header ( ) . page_size ,
97+ timestamp : self . header . sealed_at_timestamp ,
9798 } ;
9899
99100 hasher. update ( header. as_bytes ( ) ) ;
Original file line number Diff line number Diff line change @@ -246,6 +246,9 @@ impl<B> Compactor<B> {
246246 version : LIBSQL_WAL_VERSION . into ( ) ,
247247 magic : LIBSQL_MAGIC . into ( ) ,
248248 page_size : last_header. page_size ,
249+ // the new compacted segment inherit the last segment timestamp: it contains the same
250+ // logical data.
251+ timestamp : last_header. timestamp ,
249252 } ;
250253
251254 hasher. update ( header. as_bytes ( ) ) ;
You can’t perform that action at this time.
0 commit comments