[MDEV-32807] Delete spider sts and crd system tables Created: 2023-11-15  Updated: 2023-11-24

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Spider
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Yuchen Pei Assignee: Yuchen Pei
Resolution: Unresolved Votes: 0
Labels: spider-sts-crd

Issue Links:
Blocks
is blocked by MDEV-28739 Trying to lock uninitialized mutex or... Closed
Relates
relates to MDEV-28739 Trying to lock uninitialized mutex or... Closed
relates to MDEV-29421 Thread (10.6+) and server hangs (10.4... Closed

 Description   

MDEV-28739 removed all references to the mysql.spider_table_sts and mysql.spider_table_crd tables. We may want to delete these tables. Pending discussion on whether to do it, and which version



 Comments   
Comment by Yuchen Pei [ 2023-11-17 ]

Will only proceed with the deletion if
1. The solution to MDEV-29739 is removing the only calls to update the
table
2. Investigation shows the tables are indeed useless

Initial analysis shows that both the in-memory and persistent table
stats can be stale.

Consider the following:

11.0 4d8167563e79f2657454a9f410e9cf2a2673bf76

--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
create table t1 (c int) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
 
insert into t1 values (1), (2), (3);
/* 1 */ show table status like "t1";
/* 2 */ show table status like "t2";
insert into t1 values (4), (5);
/* 3 */ show table status like "t1";
/* 4 */ show table status like "t2";
select * from mysql.spider_table_sts;
 
--source include/restart_mysqld.inc
select * from mysql.spider_table_sts;
/* 5 */ show table status like "t1";
/* 6 */ show table status like "t2";
 
drop table t1, t2;
drop server srv;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

All show table status like "t1" outputs number of rows to be 2,
but the show table status like "t2" statements output accurate
numbers of rows, 3 the first time, and 5 the second and the third
times.

The first select * from mysql.spider_table_sts outputs no rows, as
expected (stats are written only on ha_close() which happens e.g. at
shutdown). The second one outputs number of rows to be 2, consistently
wrong.

If we replace the table in the first insert statement by t2, then
spider consistently reports row numbers to be 3, less wrong than 2,
but still wrong after the two extra rows are inserted.

This seems to be another instance where spider is not doing something
intended, and what is intended is unclear either... In any case,
further investigation is needed to decide what to do with these system
tables.

Generated at Thu Feb 08 10:34:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.