Bug #113257 Assertion on rpl.rpl_replication_observers_example_plugin_ongoing_transaction
Submitted: 28 Nov 2023 14:29 Modified: 25 Jun 15:01
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:Tests: Replication Severity:S6 (Debug Builds)
Version:8.2.0 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[28 Nov 2023 14:29] Laurynas Biveinis
Description:
On a 8.2.0 debug build:
$ ./mtr rpl.rpl_replication_observers_example_plugin_ongoing_transaction
...
[ 25%] rpl.rpl_replication_observers_example_plugin_ongoing_transaction 'mix'  [ fail ]
        Test ended at 2023-11-28 15:42:39

CURRENT_TEST: rpl.rpl_replication_observers_example_plugin_ongoing_transaction
mysqltest: At line 50: Query 'let $success= `$wait_condition`' failed.
ERROR 2013 (HY000): Lost connection to MySQL server during query
In included file ./include/wait_condition.inc: 61
included from /Users/laurynas/vilniusdb/mysql-8.2.0/mysql-test/suite/rpl/t/rpl_replication_observers_example_plugin_ongoing_transaction.test: 95

The result from queries just before the failure was:
INSERT INTO t1 VALUES (2);;

# 3. Leave a transaction open without commit (counted)
[connection con4]
BEGIN;
INSERT INTO t2 VALUES(1);

# 4. Leave a transaction stuck on after commit
[connection con5]
SET @@GLOBAL.DEBUG='+d,bgc_after_after_commit_stage';
INSERT INTO t2 VALUES (3);;
[connection con1]
SET @@GLOBAL.DEBUG='-d,bgc_after_after_commit_stage';
#
# 5. Execute a query that on a server hook will count the number of
#    queries
SET @@GLOBAL.DEBUG= '+d,validate_replication_observers_plugin_counts_transactions';
INSERT INTO t2 VALUES (10);;
[connection con6]
SET @@GLOBAL.DEBUG= '-d,validate_replication_observers_plugin_counts_transactions';
...
Assertion failed: (size == 3), function test_server_count_transactions, file replication_observers_example.cc, line 1044.
2023-11-28T13:42:38Z UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x12f963200
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 16ee72eb8 thread_stack 0x100000
0   mysqld                              0x000000010472b0b8 my_print_stacktrace(unsigned char const*, unsigned long) + 72
1   mysqld                              0x0000000103516380 print_fatal_signal(int) + 780
2   mysqld                              0x00000001035165d0 handle_fatal_signal + 120
3   libsystem_platform.dylib            0x000000019048fa24 _sigtramp + 56
4   libsystem_pthread.dylib             0x0000000190460cc0 pthread_kill + 288
5   libsystem_c.dylib                   0x0000000190370a40 abort + 180
6   libsystem_c.dylib                   0x000000019036fd30 err + 0
7   replication_observers_example_plugi 0x000000011027aff0 test_server_count_transactions() + 344
8   replication_observers_example_plugi 0x0000000110277ac0 trans_before_dml(Trans_param*, int&) + 452
9   mysqld                              0x000000010422f574 Trans_delegate::before_dml(THD*, int&) + 532
10  mysqld                              0x00000001030c3e18 run_before_dml_hook(THD*) + 148
11  mysqld                              0x00000001032b7140 Sql_cmd_dml::execute(THD*) + 1828
12  mysqld                              0x0000000103209290 mysql_execute_command(THD*, bool) + 10356
13  mysqld                              0x0000000103204950 dispatch_sql_command(THD*, Parser_state*) + 2636
14  mysqld                              0x00000001032006b8 dispatch_command(THD*, COM_DATA const*, enum_server_command) + 7596
15  mysqld                              0x0000000103202ecc do_command(THD*) + 1964
16  mysqld                              0x00000001034e73b8 handle_connection(void*) + 492
17  mysqld                              0x000000010564ccc8 pfs_spawn_thread(void*) + 288
18  libsystem_pthread.dylib             0x0000000190461034 _pthread_start + 136
19  libsystem_pthread.dylib             0x000000019045be3c thread_start + 8

How to repeat:
See above
[28 Nov 2023 20:50] MySQL Verification Team
Hi,

Thank you for the report. Do you see this only on debug build or with release build too?
[30 Nov 2023 9:49] Laurynas Biveinis
It's a debug-only test:

[ 50%] rpl.rpl_replication_observers_example_plugin_ongoing_transaction  [ skipped ]  Test needs debug binaries.
[30 Nov 2023 13:34] MySQL Verification Team
Hi
Thanks, I reproduced it.
[8 May 13:16] Laurynas Biveinis
Can't no longer reproduce on 8.0.37 nor 8.4.0
[25 Jun 15:01] Magnus Blåudd
Test is not failing with the reported messages anymore. The problem was an additional lingering transactions form another subsystem which was observed, that has now been fixed.

Thanks for noticing!