Skip to content

Query fails after repartition with error Logical region ... not found #7815

@WenyXu

Description

@WenyXu

What type of bug is this?

Unexpected error

What subsystems are affected?

Query Engine

Minimal reproduce step

This issue is not deterministically reproducible. It occurs during fuzz testing with concurrent inserts and repartition operations. The following SQL sequence illustrates the typical workflow where the failure was observed.

-- Step 1: Split partition
ALTER TABLE fuzz_repartition_metric_physical
SPLIT PARTITION (
  host >= '5QVb' AND host < '7Mu3'
) INTO (
  host >= '5QVb' AND host < '7Czg',
  host >= '7Czg' AND host < '7Mu3'
);

-- Step 2: Concurrent inserts into multiple metric tables
INSERT INTO `AlIQUam` (ts, `acCusamus`)
VALUES ('2026-03-13 14:13:52.672+0000', NULL);

INSERT INTO `COnSEQUATUR` (`MaioReS`, host, `eST`, ts, `NESCiunt`)
VALUES
('ad', 'voluptate', NULL, '2026-03-13 14:13:53.672+0000', 'voluptatem'),
(NULL, 'et', 'error', '2026-03-13 14:13:54.672+0000', 'molestias');

INSERT INTO `DEleniti` (ts, val, host)
VALUES ('2026-03-13 14:13:55.672+0000', 0.024464213259292822, 'culpa');

INSERT INTO `Quia` (`noN`, ts, val)
VALUES
('sint', '2026-03-13 14:13:56.672+0000', 0.8916716695957527),
('et', '2026-03-13 14:13:57.672+0000', 0.8849525113630123);

-- Step 3: Validate row counts (normally succeeds)
SELECT COUNT(1) FROM `AlIQUam`;

-- Step 4: Merge partitions
ALTER TABLE fuzz_repartition_metric_physical
MERGE PARTITION (
  host >= '5QVb' AND host < '7Czg',
  host >= '7Czg' AND host < '7Mu3'
);

-- Step 5: Continue inserts
INSERT INTO `AlIQUam` (val, `acCusamus`, `Ut`, `Est`, ts)
VALUES
(0.33308660818704217, 'impedit', 'dolores', 'voluptates', '2026-03-13 14:14:37.672+0000');

-- Step 6: Validation query may fail
SELECT COUNT(1) AS count FROM `AlIQUam`;

What did you expect to see?

Query result

What did you see instead?

Failed to decode DataFusion plan:
Logical region 4415226380354(1028, 66) not found

What operating system did you use?

doesn't matter

What version of GreptimeDB did you use?

main

Relevant log output and stack trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory Bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions