Skip to content

MDEV-40818: INSERT into a table with ENGINE=DuckDB crashes the server when binary logging is enabled. - #5936

Open
itzanway wants to merge 1 commit into
MariaDB:11.4from
itzanway:fix-mdev-40818
Open

itzanway wants to merge 1 commit into
MariaDB:11.4from
itzanway:fix-mdev-40818

Conversation

@itzanway

Copy link
Copy Markdown
Contributor

DuckDB already prepared for binlog 2PC but had no recover callback, so ha_count_rw_2pc() was 0 and Gtid_log_event asserted.

DuckDB already prepared for binlog 2PC but had no recover callback, so
ha_count_rw_2pc() was 0 and Gtid_log_event asserted. Advertise recover
(no prepared XIDs survive restart).
@grooverdan
grooverdan requested a review from drrtuy October 21, 2026 01:23
@@ -0,0 +1,20 @@
--source ../include/have_duckdb.inc
--source include/have_log_bin.inc
--source include/not_msan.inc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you remove the not_msan.inc. there's currently no compatibility problem.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Oct 21, 2026
@gkodinov gkodinov self-assigned this Oct 21, 2026

@gkodinov gkodinov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution. This is a preliminary review.

I'd like to request changes based on the .test file comment: it seems that there're some redundant tests there.

return 0;
}

#if MYSQL_VERSION_ID >= 110800

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is most likely killing the messenger.

The real issue is that Gtid_log_event::Gtid_log_event() expects that ha_count_rw_2pc() would return non-zero. And it can only return non-zero if the recover hook is defined.

Why is that, I have no idea (and is a question for the final review).

Feel free to ignore this for now, but I strongly suspect that this is wrong and it will come up in the final review.

SELECT * FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (id INT PRIMARY KEY, v VARCHAR(16)) ENGINE=DuckDB;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need two separate tables here? The mdev claims that the above is enough to reproduce.

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

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants