[MDEV-25824] Federated table with unavailable remote causes unexpected errors Created: 2021-05-30  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Federated
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-25823 Federated table with certain charset ... Open

 Description   

When a Federated table is created, access to the remote server is checked.
However, the remote server can become unavailable later. If it happens, the mere existence of the Federated table referring to it can cause troubles for other queries.

In the test case below server restart on a different port imitates disappearance of the remote server as it was configured for the Federated table.

--source include/have_innodb.inc
 
install soname 'ha_federatedx';
 
create table t1 (a int);
create database fed;
--eval create table fed.t2 (a int) engine=federated connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1'
select * from fed.t2;
select * from information_schema.referential_constraints;
 
--let $port= `SELECT @@port+1`
--let $restart_parameters= --port=$port
--source include/restart_mysqld.inc
 
select * from information_schema.referential_constraints;
 
--let $restart_parameters=
--source include/restart_mysqld.inc

On 10.3-10.6 it causes error 2013 upon the query from I_S:

10.3 1e5ebf37

query 'select * from information_schema.referential_constraints' failed: 2003: Received error: 2003 : Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")

On 10.2 it doesn't fail, but causes a strange warning (same as described in MDEV-25823 for 10.2):

10.2 d06205ba

select * from information_schema.referential_constraints;
CONSTRAINT_CATALOG	CONSTRAINT_SCHEMA	CONSTRAINT_NAME	UNIQUE_CONSTRAINT_CATALOG	UNIQUE_CONSTRAINT_SCHEMA	UNIQUE_CONSTRAINT_NAME	MATCH_OPTION	UPDATE_RULE	DELETE_RULE	TABLE_NAME	REFERENCED_TABLE_NAME
Warnings:
Warning	1939	Engine PERFORMANCE_SCHEMA failed to discover table `performance_schema`.`accounts` with 'CREATE TABLE accounts(USER CHAR(128) collate utf8_bin default null,HOST CHAR(60) collate utf8_bin default null,CURRENT_CONNECTIONS bigint not null,TOTAL_CONNECTIONS bigint not null)'


Generated at Thu Feb 08 09:40:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.