Slow INSERT on TokuDB when using XA, 2 tables, small table_open_cache and ST_ functions

Description

code
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE ti (a MEDIUMINT UNSIGNED NOT NULL, b INT UNSIGNED, c BINARY(30) NOT NULL, d VARBINARY(14) NOT NULL, e VARBINARY(96) NOT NULL, f VARCHAR(84) NOT NULL, g TINYBLOB NOT NULL, h BLOB, id BIGINT NOT NULL, KEY(b), KEY(e), PRIMARY KEY(id)) ENGINE=TokuDB;
SET SESSION PROFILING = ON;
CREATE TABLE t (a INT UNSIGNED, b TINYINT UNSIGNED NOT NULL, c CHAR(13) NOT NULL, d VARBINARY(28) NOT NULL, e VARBINARY(72) NOT NULL, f VARBINARY(27) NOT NULL, g TINYBLOB, h BLOB, id BIGINT NOT NULL, KEY(b), CLUSTERING KEY(e), PRIMARY KEY(id)) ENGINE=TokuDB;
XA START 'a';
SET @@GLOBAL.table_open_cache=2;
INSERT INTO ti VALUES (0,0,'FAST','FAST','a','a','a','a',0); # FAST
INSERT INTO t (id,a) VALUES (1,1);
SELECT ST_ASGEOJSON(ST_GEOMFROMTEXT("POINT(10.123456789 11.123456789)", 13), 4);
INSERT INTO ti VALUES (1,1,'SLOW','SLOW','b','b','b','b',1); # SLOW: 4sec+
code

Apologies for the somewhat longer-then-usual testcase. Had to manually tune this further.

The first INSERT INTO ti completes near real time, the second is 4 seconds +.

Running the same testcase with InnoDB instead against MS or against PS does not produce the same delay in either case.

Environment

None

Status

Assignee

Unassigned

Reporter

roel.vandepaar

Labels

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Freshdesk Tickets

None

Priority

Minor
Configure