Repository navigation
[flink] Stop lookup matches when dynamic partition selection is empty - #11355
zhangyue19921010 wants to merge 2 commits into
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
The original stale lookup reproduces in all five cases with the base lookup class. The patch passes all 25 selected Flink tests, including three SQL lookup join cases. I found a separate stale result on the empty-to-nonempty transition.
| if (partitionLoader.partitions().isEmpty()) { | ||
| return Collections.emptyList(); | ||
| } | ||
| List<BinaryRow> partitions = |
There was a problem hiding this comment.
[P2] Keep the pre-drop cache invalid after the selection becomes empty. I extended the existing real-table regression with a check on the first lookup after recreating pt=1. The join returned no matches after the truncate, but the first lookup after writing (1, 2, 4) then returned the deleted value 3 in both async FULL and async MEMORY modes. The partition loader becomes nonempty and schedules a rebuild, while currentPartitions() still refers to the pre-truncate cache. Preserve the empty lookup state until a cache built after that empty selection is installed. The existing test waits for 4, which misses this interval.
There was a problem hiding this comment.
Fixed in 4976a0d: when the selection becomes empty, the refresher now clears its current partitions and drops async refreshes started before that, so lookups stay empty until a cache built after the empty selection is installed (the test now checks the first lookup after recreating pt=1).
Purpose
Dynamic lookup joins keep returning cached rows after the last selected partition is removed. Return no matches when the refreshed partition selection is empty, while retaining the existing asynchronous cache switch for nonempty selections.
Fixes #11354.
Tests
FileStoreLookupFunctionTestandPartitionRefresherTest(22 tests).