Skip to content

Commit

Permalink
Remove redundant check in check_is_chunk_order_violated_by_merge
Browse files Browse the repository at this point in the history
We never hit this check and this is verified earlier, additionally
the logic for the check was wrong and should have been or instead
of and.
  • Loading branch information
svenklemm committed Mar 2, 2025
1 parent b665a4b commit d3ff379
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tsl/src/compression/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ find_chunk_to_merge_into(Hypertable *ht, Chunk *current_chunk)
* after the existing data according to the compression order. This is true if the data being merged
* in has timestamps greater than the existing data and the first column in the order by is time
* ASC.
*
* The CompressChunkCxt references the chunk we are merging and mergable_chunk is the chunk we
* are merging into.
*/
static bool
check_is_chunk_order_violated_by_merge(CompressChunkCxt *cxt, const Dimension *time_dim,
Expand All @@ -364,12 +367,6 @@ check_is_chunk_order_violated_by_merge(CompressChunkCxt *cxt, const Dimension *t
if (!compressed_slice)
elog(ERROR, "compressed chunk has no time dimension slice");

if (mergable_slice->fd.range_start > compressed_slice->fd.range_start &&
mergable_slice->fd.range_end > compressed_slice->fd.range_start)
{
return true;
}

CompressionSettings *ht_settings =
ts_compression_settings_get(mergable_chunk->hypertable_relid);

Expand Down

0 comments on commit d3ff379

Please sign in to comment.