Skip to content

newsql: don't send a postponed row that was never saved: cldeadlock fix - #6176

Merged
markhannum merged 1 commit into
bloomberg:mainfrom
markhannum:fix-postponed-row-segv
Aug 29, 2026
Merged

newsql: don't send a postponed row that was never saved: cldeadlock fix#6176
markhannum merged 1 commit into
bloomberg:mainfrom
markhannum:fix-postponed-row-segv

Conversation

@markhannum

Copy link
Copy Markdown
Contributor

run_stmt() set postponed_write even when the postponing send_row() failed, so post_sqlite_processing() went on to send a row that was never saved and newsql_write_postponed_evbuffer() dereferenced a NULL appdata->postponed.

Only set postponed_write when the save succeeded, and NULL-check in newsql_send_postponed_row() as a backstop.

Surfaced under cldeadlock. Rows are only postponed for a select replayed inside a transaction; which encode failure left appdata->postponed NULL there is not confirmed. The fix holds regardless of which one fired.

Issue discovered by the 'cldeadlock' test.

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_truncate [db unavailable at finish]
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**

run_stmt() set postponed_write even when the postponing send_row() failed,
so post_sqlite_processing() sent a row that was never saved and
newsql_write_postponed_evbuffer() dereferenced a NULL appdata->postponed.

Signed-off-by: Mark Hannum <[email protected]>
@markhannum
markhannum force-pushed the fix-postponed-row-segv branch from eba203a to 585f295 Compare August 28, 2026 20:10

@roborivers roborivers 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.

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_constraints
sc_constraints_logicalsc_generated
timepart_retro
unionpar_maxqueue
sc_resume
sc_resume_logicalsc_generated **quarantined**
sc_partial_datacopy
sc_partial_datacopy_logicalsc_generated **quarantined**
sc_datacopy_logicalsc_generated **quarantined**
sc_datacopy

@markhannum
markhannum merged commit 73c6f37 into bloomberg:main Aug 29, 2026
5 checks passed
@markhannum
markhannum deleted the fix-postponed-row-segv branch August 29, 2026 15:28
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.

3 participants