Skip to content

Fix flaky bfv_cte test - #2383

Open
leborchuk wants to merge 1 commit into
apache:mainfrom
leborchuk:fix-flaky-bfv-cte
Open

leborchuk wants to merge 1 commit into
apache:mainfrom
leborchuk:fix-flaky-bfv-cte

Conversation

@leborchuk

Copy link
Copy Markdown
Contributor

The Share Input Scan part of bfv_cte checks the SISC debug LOG messages from seg2 in the order they appear in the client output. These messages are written by different QE processes, the SISC writer and one or two readers, and reach the client through separate QE connections, so the order in which the QD relays them is not deterministic. The test then fails now and then, e.g. with the ORCA plan, where one reader's "wrote notify_done" can arrive before the other reader's "initialized xslice state":

-LOG: SISC (shareid=0, slice={2|4}): initialized xslice state
LOG: SISC READER (shareid=0, slice={2|4}): wrote notify_done
+LOG: SISC (shareid=0, slice={2|4}): initialized xslice state
LOG: SISC READER (shareid=0, slice={2|4}): wrote notify_done

Print the LOG lines sorted, followed by the rest of the output. The test still checks which slice initializes the shared state and that every reader and the writer log the expected steps; the order between processes was never guaranteed anyway.

The Share Input Scan part of bfv_cte checks the SISC debug LOG messages
from seg2 in the order they appear in the client output.  These
messages are written by different QE processes, the SISC writer and
one or two readers, and reach the client through separate QE
connections, so the order in which the QD relays them is not
deterministic.  The test then fails now and then, e.g. with the ORCA
plan, where one reader's "wrote notify_done" can arrive before the
other reader's "initialized xslice state":

 -LOG:  SISC (shareid=0, slice={2|4}): initialized xslice state
  LOG:  SISC READER (shareid=0, slice={2|4}): wrote notify_done
 +LOG:  SISC (shareid=0, slice={2|4}): initialized xslice state
  LOG:  SISC READER (shareid=0, slice={2|4}): wrote notify_done

Print the LOG lines sorted, followed by the rest of the output.  The
test still checks which slice initializes the shared state and that
every reader and the writer log the expected steps; the order between
processes was never guaranteed anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change stabilizing bfv_cte log ordering.

No open issues 🎉

What changed in this PR

This PR stabilizes the bfv_cte regression test by removing its dependence on the arrival order of Share Input Scan logs from separate query-executor processes.

Changes:

  • Sort relevant seg2 LOG messages using LC_ALL=C, then print non-LOG output.
  • Update both planner-specific expected outputs to match the new ordering while preserving checks for expected log messages.
File Description
src/​test/​regress/​sql/​bfv_cte.sql Sorts filtered logs and documents why arrival order is nondeterministic.
src/​test/​regress/​expected/​bfv_cte.out Updates the standard planner’s expected output ordering.
src/​test/​regress/​expected/​bfv_cte_optimizer.out Updates the ORCA planner’s expected output ordering.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants