Files
greptimedb/src/datanode
jeremyhi 21e4c48f2e fix(datanode): keep remote dynamic filter registrations that race with query state removal (#10467)
* fix(datanode): keep remote dynamic filter registrations that race with query state removal

A region could register its remote dynamic filters into a per-query state
that a concurrent removal had just dropped from the registry while it was
empty. The registration returned its filter ids, but the lookup at plan
time found nothing for the query, so the region scanned without the
dynamic filter.

Registration now checks, after releasing the per-query lock, that the
registry still holds the state it registered into, and registers again
otherwise.

The registry entry gauge follows the lifetime of RegisteredDynFilter, so
entries written into a discarded state are counted out when it drops.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* test(datanode): require the race test to remove the query state

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(datanode): state why the registration check follows the query lock

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(datanode): drop a doc line that restates is_current_query

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(datanode): describe the remote dynamic filter gauge as live registrations

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* test(datanode): give each racing region its own remote dynamic filter

A shared filter id let another region's live registration satisfy the lookup, so a lost registration failed the test only by chance. Also note why the deterministic race test removes the query state directly.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-11-18 10:50:56 +00:00
..