Skip to content

Commit

Permalink
FB8-80: Display row information in processlist for rbr threads (faceb…
Browse files Browse the repository at this point in the history
…ook#953) (facebook#953)

Summary:
Jira ticket: https://jira.percona.com/browse/FB8-80

Reference Patch: facebook@564824a

Set row_query using the fields unpacked from the row event. Use row_query in show processlist.
Pull Request resolved: facebook#953

Reviewed By: lloyd

Differential Revision: D14137212

Pulled By: lth
  • Loading branch information
santoshbanda authored and inikep committed Jul 19, 2024
1 parent 1413061 commit 9948ffc
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ INSERT INTO t1 VALUES(1);
SET DEBUG_SYNC= "now WAIT_FOR deleted_rows_query_ev";
SELECT state,info FROM information_schema.processlist WHERE state like 'debug%';;
state debug sync point: now
info NULL
info INSERT INTO test.t1 (1)
Warnings:
Level Warning
Code 1287
Expand Down
36 changes: 18 additions & 18 deletions mysql-test/suite/rpl/r/rpl_multi_source_row_stages.result
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,36 @@ Commit;
check on channel_1
include/start_slave_sql.inc [FOR CHANNEL 'channel_1']
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=test, info LIKE "INSERT INTO t1 VALUES (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=test, info LIKE "INSERT INTO test.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "INSERT INTO test.t1 (1)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "INSERT INTO test.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=test, info LIKE "UPDATE t1 SET a= 2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "UPDATE t1 SET a= 2", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "UPDATE t1 SET a= 2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=test, info LIKE "UPDATE test.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "UPDATE test.t1 (1)(2)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "UPDATE test.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=test, info LIKE "DELETE FROM t1 WHERE a=2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "DELETE FROM t1 WHERE a=2", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "DELETE FROM t1 WHERE a=2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=test, info LIKE "DELETE FROM test.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "DELETE FROM test.t1 (2)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "DELETE FROM test.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
check on channel_3
include/start_slave_sql.inc [FOR CHANNEL 'channel_3']
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=test, info LIKE "INSERT INTO t1 VALUES (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=test, info LIKE "INSERT INTO test.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "INSERT INTO test.t1 (1)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "INSERT INTO test.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=test, info LIKE "UPDATE t1 SET a= 2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "UPDATE t1 SET a= 2", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "UPDATE t1 SET a= 2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=test, info LIKE "UPDATE test.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "UPDATE test.t1 (1)(2)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "UPDATE test.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=test, info LIKE "DELETE FROM t1 WHERE a=2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "DELETE FROM t1 WHERE a=2", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "DELETE FROM t1 WHERE a=2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=test, info LIKE "DELETE FROM test.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=test, info LIKE "DELETE FROM test.t1 (2)", command=Query]
[SHOW PROCESSLIST reports: db=test, info LIKE "DELETE FROM test.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
# Removing debug point 'dbug.rpl_apply_sync_barrier' from @@GLOBAL.debug
[connection server_1]
Expand Down
66 changes: 33 additions & 33 deletions mysql-test/suite/rpl/r/rpl_row_stages.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ COMMIT;
# Adding debug point 'dbug.rpl_apply_sync_barrier' to @@GLOBAL.debug
include/start_slave_sql.inc
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info LIKE "INSERT INTO t1 VALUES (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info LIKE "UPDATE t1 SET c1= 2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "UPDATE t1 SET c1= 2", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "UPDATE t1 SET c1= 2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info LIKE "DELETE FROM t1 WHERE c1=2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "DELETE FROM t1 WHERE c1=2", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "DELETE FROM t1 WHERE c1=2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
[connection master]
SET @@SESSION.BINLOG_ROWS_QUERY_LOG_EVENTS=0;
Expand All @@ -50,19 +50,19 @@ COMMIT;
# Adding debug point 'dbug.rpl_apply_sync_barrier' to @@GLOBAL.debug
include/start_slave_sql.inc
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info IS NULL, Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info IS NULL, command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE 'NULL', command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info IS NULL, Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info IS NULL, command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE 'NULL', command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info IS NULL, Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info IS NULL, command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE 'NULL', command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", command=Query]
[SHOW PROCESSLIST reports: db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
# Removing debug point 'dbug.rpl_apply_sync_barrier' from @@GLOBAL.debug
[connection master]
Expand All @@ -81,22 +81,22 @@ BEGIN;
BINLOG 'mSKWVhMBAAAAMgAAAOYCAAAAAPAAAAAAAAEACWRiX3dsNzM2NAACdDEAAQMAAfg9wnk=mSKWVh4BAAAAKAAAAA4DAAAAAPAAAAAAAAEAAgAB//4BAAAAnirPSw==';
[connection master]
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info LIKE "BINLOG %", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "BINLOG %", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "INSERT INTO db_wl7364.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
[connection master1]
BINLOG 'mSKWVhMBAAAAMgAAAGsDAAAAAPAAAAAAAAEACWRiX3dsNzM2NAACdDEAAQMAAWFoKHE=mSKWVh8BAAAALgAAAJkDAAAAAPAAAAAAAAEAAgAB///+AQAAAP4CAAAAuiHqhw==';
[connection master]
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info LIKE "BINLOG %", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "BINLOG %", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "UPDATE db_wl7364.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
[connection master1]
BINLOG 'mSKWVhMBAAAAMgAAAPwDAAAAAPAAAAAAAAEACWRiX3dsNzM2NAACdDEAAQMAAd+b01A=mSKWViABAAAAKAAAACQEAAAAAPAAAAAAAAEAAgAB//4CAAAAN7fZXg== ';
[connection master]
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info LIKE "BINLOG %", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "BINLOG %", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db_wl7364, info LIKE "DELETE FROM db_wl7364.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
[connection master1]
COMMIT;
Expand Down Expand Up @@ -221,19 +221,19 @@ COMMIT;
# Adding debug point 'dbug.rpl_apply_sync_barrier' to @@GLOBAL.debug
include/start_slave_sql.inc
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db2, info LIKE "INSERT INTO t1 VALUES (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "INSERT INTO t1 VALUES (1)", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (write), db=db2, info LIKE "INSERT INTO db2.t1 (1)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "INSERT INTO db2.t1 (1)", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "INSERT INTO db2.t1 (1)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db2, info LIKE "UPDATE t1 SET c1= 2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "UPDATE t1 SET c1= 2", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "UPDATE t1 SET c1= 2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (update), db=db2, info LIKE "UPDATE db2.t1 (1)(2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "UPDATE db2.t1 (1)(2)", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "UPDATE db2.t1 (1)(2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
SET debug_sync= 'now WAIT_FOR signal.rpl_row_apply_progress_updated';
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db2, info LIKE "DELETE FROM t1 WHERE c1=2", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "DELETE FROM t1 WHERE c1=2", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "DELETE FROM t1 WHERE c1=2", command=Query]
include/assert.inc [PERFORMANCE_SCHEMA.threads reports: state=Applying batch of row changes (delete), db=db2, info LIKE "DELETE FROM db2.t1 (2)", Query]
include/assert.inc [INFORMATION_SCHEMA.processlist reports: db=db2, info LIKE "DELETE FROM db2.t1 (2)", command=Query]
[SHOW PROCESSLIST reports: db=db2, info LIKE "DELETE FROM db2.t1 (2)", command=Query]
SET debug_sync= 'now SIGNAL signal.rpl_row_apply_process_next_row';
[connection slave]
# Removing debug point 'dbug.rpl_apply_sync_barrier' from @@GLOBAL.debug
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--slave_parallel_workers=0
6 changes: 3 additions & 3 deletions mysql-test/suite/rpl/t/rpl_multi_source_row_stages.test
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ while ($j)
if ($i == 3)
{
--let $state_progress= Applying batch of row changes (write)
--let $info= INSERT INTO t1 VALUES (1)
--let $info= INSERT INTO test.t1 (1)
}
if ($i == 2)
{
--let $state_progress= Applying batch of row changes (update)
--let $info= UPDATE t1 SET a= 2
--let $info= UPDATE test.t1 (1)(2)
}
if ($i == 1)
{
--let $state_progress= Applying batch of row changes (delete)
--let $info= DELETE FROM t1 WHERE a=2
--let $info= DELETE FROM test.t1 (2)
}

# this session waits for the progress to be updated
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/rpl/t/rpl_row_stages-slave.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--slave_parallel_workers=0
Loading

0 comments on commit 9948ffc

Please sign in to comment.