[MCOL-4487] ORDER BY RAND() ERROR 1815 (HY000): Internal error: IDB-2045: At least one PrimProc closed the connection unexpectedly. Created: 2021-01-06  Updated: 2022-02-07  Resolved: 2021-11-02

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 5.5.1
Fix Version/s: 6.2.1, 6.2.2

Type: Bug Priority: Critical
Reporter: Rob Schwyzer Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Environment:

MariaDB 10.5.8-5 ES running on CentOS 7.9 on AWS t2.xlarge instance


Issue Links:
Duplicate
duplicates MCOL-4771 Rand() Killing PrimProc Under Certain... Closed
Sprint: 2021-10, 2021-11, 2021-12, 2021-13, 2021-14

 Description   

Create Schema

CREATE DATABASE test;
USE test;
 
CREATE TABLE `innodbt` (
  `C_` varchar(100) DEFAULT NULL,
  `A_` varchar(100) DEFAULT NULL,
  `B_` varchar(100) DEFAULT NULL,
  `D_` varchar(100) DEFAULT NULL,
  `E_` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
CREATE TABLE `colstore` (
  `C_` varchar(100) DEFAULT NULL,
  `A_` varchar(100) DEFAULT NULL,
  `B_` varchar(100) DEFAULT NULL,
  `D_` varchar(100) DEFAULT NULL,
  `E_` varchar(100) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8;
 
DELIMITER $$
CREATE PROCEDURE gendemo()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE i < 50000 DO
INSERT INTO `innodbt` (C_,A_,B_,D_,E_) VALUES (
ROUND((RAND() * 100000),0), ROUND((RAND() * 100000),0), ROUND((RAND() * 100000),0), ROUND((RAND() * 100000),0),
1
);
SET i = i + 1;
END WHILE;
insert into colstore select * from innodbt;
END$$
DELIMITER ;
 
CALL gendemo();
 
insert into innodbt( C_, A_, B_, D_, E_) select C_, A_, B_, D_ , E_
FROM (select 'text' as C_, A_, B_, D_ , E_ FROM colstore
)derived;

Populate Schema

Run CALL gendemo(); then insert into innodbt snippet from above until SELECT COUNT FROM `colstore`; returns 2300000.

Run Test

USE test;
select * from `colstore`order by rand();

Expected Output

ERROR 1815 (HY000): Internal error: IDB-2045: At least one PrimProc closed the connection unexpectedly.



 Comments   
Comment by David Hall (Inactive) [ 2021-10-27 ]

I'm not sure why this breaks in columnstore-5. It's breaking during an attempt to reallocate a std::vector as it grows.

The function has been re-engineered in develop-6 and this Vector no longer exists, so the problem doesn't manifest.

Comment by Daniel Lee (Inactive) [ 2021-11-02 ]

Build verified: 6.2.1-1 (#3282)

Verified the issue is no longer happening in this build. Closing this duplicate ticket.

Generated at Thu Feb 08 02:50:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.