fix: Level 1 files need to be sorted by max sequence number for full compaction

pull/24376/head
Carol (Nichols || Goulding) 2022-09-15 11:46:20 -04:00
parent dc64e494bd
commit 9b99af08e4
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,8 @@ pub(crate) struct ParquetFilesForCompaction {
/// sequence number.
pub(crate) level_0: Vec<CompactorParquetFile>,
/// Parquet files for a partition with `CompactionLevel::FileNonOverlapped`. Arbitrary order.
/// Parquet files for a partition with `CompactionLevel::FileNonOverlapped`. Ordered by
/// ascending max sequence number.
pub(crate) level_1: Vec<CompactorParquetFile>,
/// Parquet files for a partition with `CompactionLevel::Final`. Arbitrary order.
@ -96,6 +97,7 @@ impl ParquetFilesForCompaction {
}
level_0.sort_by_key(|pf| pf.max_sequence_number());
level_1.sort_by_key(|pf| pf.max_sequence_number());
Ok(Self {
level_0,