【 TiDB 使用环境】生产环境
【 TiDB 版本】v6.5.3
root账户删这张表的记录,没有权限,请问如何才能删掉这里的记录
为啥要操作 TiDB 的内部系统表呢?有错误数据吗?你把这条数据对应的表删了不就没了吗
{
"select * from INFORMATION_SCHEMA.TABLES t where TABLE_NAME='user_all' and table_schema='wfks_web'": [
{
"TABLE_CATALOG" : "def",
"TABLE_SCHEMA" : "wfks_web",
"TABLE_NAME" : "user_all",
"TABLE_TYPE" : "BASE TABLE",
"ENGINE" : "InnoDB",
"VERSION" : 10,
"ROW_FORMAT" : "Compact",
"TABLE_ROWS" : 0,
"AVG_ROW_LENGTH" : 0,
"DATA_LENGTH" : 0,
"MAX_DATA_LENGTH" : 0,
"INDEX_LENGTH" : 0,
"DATA_FREE" : 0,
"AUTO_INCREMENT" : null,
"CREATE_TIME" : "2024-12-24 17:38:42",
"UPDATE_TIME" : null,
"CHECK_TIME" : null,
"TABLE_COLLATION" : "utf8mb4_bin",
"CHECKSUM" : null,
"CREATE_OPTIONS" : "",
"TABLE_COMMENT" : "",
"TIDB_TABLE_ID" : 13035,
"TIDB_ROW_ID_SHARDING_INFO" : "NOT_SHARDED",
"TIDB_PK_TYPE" : "NONCLUSTERED",
"TIDB_PLACEMENT_POLICY_NAME" : null
},
{
"TABLE_CATALOG" : "def",
"TABLE_SCHEMA" : "wfks_web",
"TABLE_NAME" : "user_all",
"TABLE_TYPE" : "BASE TABLE",
"ENGINE" : "InnoDB",
"VERSION" : 10,
"ROW_FORMAT" : "Compact",
"TABLE_ROWS" : 0,
"AVG_ROW_LENGTH" : 0,
"DATA_LENGTH" : 0,
"MAX_DATA_LENGTH" : 0,
"INDEX_LENGTH" : 0,
"DATA_FREE" : 0,
"AUTO_INCREMENT" : null,
"CREATE_TIME" : "2024-12-24 20:10:23",
"UPDATE_TIME" : null,
"CHECK_TIME" : null,
"TABLE_COLLATION" : "utf8mb4_bin",
"CHECKSUM" : null,
"CREATE_OPTIONS" : "",
"TABLE_COMMENT" : "",
"TIDB_TABLE_ID" : 13043,
"TIDB_ROW_ID_SHARDING_INFO" : "NOT_SHARDED",
"TIDB_PK_TYPE" : "CLUSTERED",
"TIDB_PLACEMENT_POLICY_NAME" : null
}
]}
这张表里出现了一些类似这样,库名.表名 完全一样,tidb_table_id不同的记录,导致tispark无法使用
bug吧。建表的时候怎么可能表明一样呢
并不清楚原因,这个是冷备库,用的br pitr,上游库是正常的
比较奇怪了,很少见这种情况,你知道这是如何发生的吗,我看表也是最近 2 天创建的,你这集群写入用过 tispark 吗
没有写入,是只读的
手工执行语句查询也是这样吗?
为何要删除系统表的数据呢?
上面说了原因了
不止这一张表
{
"select * from INFORMATION_SCHEMA.TABLES t where TABLE_NAME='manager_site_column'": [
{
"TABLE_CATALOG" : "def",
"TABLE_SCHEMA" : "wfks_kms",
"TABLE_NAME" : "manager_site_column",
"TABLE_TYPE" : "BASE TABLE",
"ENGINE" : "InnoDB",
"VERSION" : 10,
"ROW_FORMAT" : "Compact",
"TABLE_ROWS" : 0,
"AVG_ROW_LENGTH" : 0,
"DATA_LENGTH" : 0,
"MAX_DATA_LENGTH" : 0,
"INDEX_LENGTH" : 0,
"DATA_FREE" : 0,
"AUTO_INCREMENT" : 1,
"CREATE_TIME" : "2024-06-04 15:01:16",
"UPDATE_TIME" : null,
"CHECK_TIME" : null,
"TABLE_COLLATION" : "utf8mb4_bin",
"CHECKSUM" : null,
"CREATE_OPTIONS" : "",
"TABLE_COMMENT" : "站点管理-栏目管理",
"TIDB_TABLE_ID" : 12229,
"TIDB_ROW_ID_SHARDING_INFO" : "NOT_SHARDED(PK_IS_HANDLE)",
"TIDB_PK_TYPE" : "CLUSTERED",
"TIDB_PLACEMENT_POLICY_NAME" : null
},
{
"TABLE_CATALOG" : "def",
"TABLE_SCHEMA" : "wfks_kms",
"TABLE_NAME" : "manager_site_column",
"TABLE_TYPE" : "BASE TABLE",
"ENGINE" : "InnoDB",
"VERSION" : 10,
"ROW_FORMAT" : "Compact",
"TABLE_ROWS" : 0,
"AVG_ROW_LENGTH" : 0,
"DATA_LENGTH" : 0,
"MAX_DATA_LENGTH" : 0,
"INDEX_LENGTH" : 0,
"DATA_FREE" : 0,
"AUTO_INCREMENT" : 1,
"CREATE_TIME" : "2024-07-12 16:22:45",
"UPDATE_TIME" : null,
"CHECK_TIME" : null,
"TABLE_COLLATION" : "utf8mb4_bin",
"CHECKSUM" : null,
"CREATE_OPTIONS" : "",
"TABLE_COMMENT" : "站点管理-栏目管理",
"TIDB_TABLE_ID" : 12357,
"TIDB_ROW_ID_SHARDING_INFO" : "NOT_SHARDED(PK_IS_HANDLE)",
"TIDB_PK_TYPE" : "CLUSTERED",
"TIDB_PLACEMENT_POLICY_NAME" : null
},
{
"TABLE_CATALOG" : "def",
"TABLE_SCHEMA" : "wfks_kms",
"TABLE_NAME" : "manager_site_column",
"TABLE_TYPE" : "BASE TABLE",
"ENGINE" : "InnoDB",
"VERSION" : 10,
"ROW_FORMAT" : "Compact",
"TABLE_ROWS" : 0,
"AVG_ROW_LENGTH" : 0,
"DATA_LENGTH" : 0,
"MAX_DATA_LENGTH" : 0,
"INDEX_LENGTH" : 0,
"DATA_FREE" : 0,
"AUTO_INCREMENT" : 1,
"CREATE_TIME" : "2024-07-19 13:39:22",
"UPDATE_TIME" : null,
"CHECK_TIME" : null,
"TABLE_COLLATION" : "utf8mb4_bin",
"CHECKSUM" : null,
"CREATE_OPTIONS" : "",
"TABLE_COMMENT" : "站点管理-栏目管理",
"TIDB_TABLE_ID" : 12364,
"TIDB_ROW_ID_SHARDING_INFO" : "NOT_SHARDED(PK_IS_HANDLE)",
"TIDB_PK_TYPE" : "CLUSTERED",
"TIDB_PLACEMENT_POLICY_NAME" : null
}
]}
有做过其他特殊的操作吗,实在排查不出来,建议导出数据,重建集群吧
发的信息是tispark里的吧,我的意思是手工执行能查到几个表?
是不是truncate了没有gc处理掉
能查到表,这几个select语句都是tidb中执行的,现在的情况是tidb不受影响,但是tispark不行。
我这个库仅通过br pitr 恢复上游库。
我觉得应该出现了删除同名表的操作,你看看gc时间多久
上游库gc时间24小时,每6小时通过br pitr导入一次下游库。 下游库gc时间10分钟
那你的上游是什么样的? 同名的表也有两张吗?