Skip to content

Commit

Permalink
Datastore: don't eagerly sort in bucket split rountine on ingestion p…
Browse files Browse the repository at this point in the history
…ath (#4417)

This should fix #4415, although without knowing how exactly the user
ended up in that situation it's hard to say for certain.
  • Loading branch information
teh-cmc authored Dec 1, 2023
1 parent 275639c commit ec77988
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions crates/re_arrow_store/src/store_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,19 @@ impl IndexedBucket {
} = self;

let mut inner1 = inner.write();

if inner1.col_time.len() < 2 {
return None; // early exit: can't split the unsplittable
}

if inner1.time_range.abs_length() == 0 {
// The entire bucket contains only one timepoint, thus it's impossible to find
// a split index to begin with.
return None;
}

re_tracing::profile_function!();

inner1.sort();

let IndexedBucketInner {
Expand All @@ -564,18 +577,6 @@ impl IndexedBucket {
size_bytes: _, // NOTE: recomputed below
} = &mut *inner1;

if col_time1.len() < 2 {
return None; // early exit: can't split the unsplittable
}

if col_time1.first() == col_time1.last() {
// The entire bucket contains only one timepoint, thus it's impossible to find
// a split index to begin with.
return None;
}

re_tracing::profile_function!();

let timeline = *timeline;

// Used in debug builds to assert that we've left everything in a sane state.
Expand Down

0 comments on commit ec77988

Please sign in to comment.