Skip to content

dbi 604 handle replication slot creation getting stuck#4439

Merged
masterashu merged 11 commits into
mainfrom
dbi-604-handle-replication-slot-creation-getting-stuck
Jun 25, 2026
Merged

dbi 604 handle replication slot creation getting stuck#4439
masterashu merged 11 commits into
mainfrom
dbi-604-handle-replication-slot-creation-getting-stuck

Conversation

@masterashu

Copy link
Copy Markdown
Contributor
  • Handle status terminating during resync-drop-flow.
  • Add user facing logs for waiting replication slot creation warning.
    • Streaming replication protocol doesn't support timeouts, so best we can do is user warning

@masterashu masterashu requested a review from a team as a code owner June 17, 2026 16:54
@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The actual e2e tests passed; failures are isolated to the "Ingest tests results for analysis" CI infrastructure step, where the analytics ClickHouse endpoint returned HTTP 500 "Timeout error" — a network/infra issue, not a code bug.
Confidence: 0.97

✅ Automatically retrying the workflow

View workflow run

@masterashu masterashu self-assigned this Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The actual test step passed; only the "Ingest tests results for analysis" telemetry step failed because the stresshouse ClickHouse metrics instance rejected the upload with a "Too many simultaneous queries (1007/1000)" rate-limit error after exhausting retries — an infrastructure issue, not a code bug.
Confidence: 0.97

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The actual tests passed; the only failure is the CI "Ingest tests results for analysis" step hitting repeated HTTP 500 "Timeout error" responses from the external analytics-upload endpoint, an infrastructure/network issue unrelated to the test code.
Confidence: 0.97

✅ Automatically retrying the workflow

View workflow run

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1552 1 1551 11
View the full list of 1 ❄️ flaky test(s)
::TestMain

Flake rate in main: 100.00% (Passed 0 times, Failed 89 times)

Stack Traces | 0s run time
FAIL	github..../peerdb/flow/e2e [build failed]

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

❌ Test Failure

Analysis: The new TestApiMongo/TestDropRunningFlow fails deterministically with an "unsupported operation" error at drop_flow_test.go:18 across multiple matrix configs, indicating a real bug in the PR's new drop-flow code path (no timeout/race/network/intermittent characteristics).
Confidence: 0.9

⚠️ This appears to be a real bug - manual intervention needed

View workflow run

@masterashu masterashu requested a review from ilidemi June 23, 2026 04:43
Comment thread flow/activities/snapshot_activity.go Outdated

logger.Info("waiting for slot to be created...")
slotCreateStart := time.Now()
stopSlotCreateWarning := common.Interval(ctx, 5*time.Minute, func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's move this into postgres connector. We've only seen the problem there and the logged advice only applies there

}

if input.Resync {
if input.Resync && activeSignal != model.TerminateSignal {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If terminate signal arrived during RemoveFlowDetailsFromCatalog activity, in the end the catalog row is not removed and stays as RESYNC. Can introduce finalDrop bool, starting as false and set to true when the terminate signal comes as part of the handler here, and run RemoveFlowDetailsFromCatalogRequest again if it was resync and now a termination

Comment thread flow/workflows/drop_flow.go Outdated
var onFlowSignal func(model.CDCFlowSignal, bool)
onFlowSignal = func(val model.CDCFlowSignal, _ bool) {
activeSignal = model.FlowSignalHandler(activeSignal, val, logger)
flowSignalChan.AddToSelector(sigSelector, onFlowSignal)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we needs a second AddToSelector inside the callback (same for onStateChange)? The callback can be inlined then

var onStateChange func(*protos.FlowStateChangeRequest, bool)
onStateChange = func(req *protos.FlowStateChangeRequest, _ bool) {
if req.RequestedFlowState == protos.FlowStatus_STATUS_TERMINATING {
activeSignal = model.TerminateSignal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Propagate req.SkipDestinationDrop and req.DropMirrorStats as well

@masterashu masterashu force-pushed the dbi-604-handle-replication-slot-creation-getting-stuck branch from 6169b21 to 4b9278f Compare June 23, 2026 12:06
@masterashu masterashu requested a review from a team as a code owner June 23, 2026 12:06
@github-actions

Copy link
Copy Markdown
Contributor

❌ Test Failure

Analysis: Deterministic compile/build failure — e2e/postgres_qrep_test.go:157 calls s.conn.SetupReplication with too few arguments after a signature change, causing the e2e package to fail to build (not a flaky test).
Confidence: 0.99

⚠️ This appears to be a real bug - manual intervention needed

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

❌ Test Failure

Analysis: A deterministic Go compilation error ("not enough arguments in call to s.conn.SetupReplication" in e2e/postgres_qrep_test.go:157) caused the e2e package to fail to build, which is a real code bug, not a flaky test.
Confidence: 0.99

⚠️ This appears to be a real bug - manual intervention needed

View workflow run

@masterashu masterashu requested a review from a team as a code owner June 23, 2026 13:01

@ilidemi ilidemi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome job

@masterashu masterashu enabled auto-merge (squash) June 25, 2026 05:21
@masterashu masterashu merged commit e490cee into main Jun 25, 2026
16 checks passed
@masterashu masterashu deleted the dbi-604-handle-replication-slot-creation-getting-stuck branch June 25, 2026 05:38
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