Got error 1 'NotFound: ' from ROCKSDB

I use pt-archiver to archive data.

percona 8.0.25-15 with rocksdb

Questions as follows:

REPLACE INTO `mre_shard_archives`.`ias_m_product_list_image`(`id`,`spu_id`,`sn`,`pdc_size_id`,`template_id`,`img_hash_cal_time`,`img_url`,`img_hash_id`,`img_type`,`available_tag`,`is_deleted`,`create_time`,`update_time`,`base_url_hash_id`,`img_style`) VALUES (1943543,'898263707026407453','JX21Q38DC8191401','2','0','2021-12-21 14:11:55','https://xxxxx.com/upload/merchandise/abcedf/615051/2021/0927/49/b7fc1709-52da-4047-9c3f-c647ad373923.jpg','b152a725ae1c555d5afdb194fb760f07','1','0','1','2021-12-21 14:11:55','2021-12-21 14:12:11','fda46b7001b5ae641cf58fde30c04361','0');
ERROR 1296 (HY000): Got error 1 'NotFound: ' from ROCKSDB

select * from `mre_shard_archives`.`ias_m_product_list_image` where id=1943543;
Empty set (0.00 sec)

Please look at mysql’s error log for more information. Paste the error log sections here so we can see.

There is no information in error log.
This error is the information returned to the client.

2021-12-17T10:34:27.364860+08:00 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: dad465cd-5ee1-11ec-a6d8-001b21c24b00.
2021-12-17T10:34:27.493721+08:00 0 [System] [MY-010931] [Server] /apps/svr/percona8/bin/mysqld: ready for connections. Version: ‘8.0.25-15’ socket: ‘/tmp/mysql3307.sock’ port: 3307 Percona Server (GPL), Release 15, Revision a558ec2.

I think it might be the unique key

My Test Case:

CREATE TABLE `ias_m_product_list_image` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT ,
  `spu_id` bigint unsigned NOT NULL DEFAULT '0' ,
  `sn` varchar(128) NOT NULL DEFAULT '' ,
  `pdc_size_id` int unsigned NOT NULL DEFAULT '0' ,
  `template_id` bigint unsigned NOT NULL DEFAULT '0' ,
  `img_hash_cal_time` timestamp NOT NULL DEFAULT '1980-01-01 00:00:00' ,
  `img_url` varchar(255) NOT NULL DEFAULT '' ,
  `img_hash_id` varchar(40) NOT NULL DEFAULT '' ,
  `img_type` tinyint NOT NULL DEFAULT '0' ,
  `available_tag` tinyint NOT NULL DEFAULT '0' ,
  `is_deleted` tinyint NOT NULL DEFAULT '0' ,
  `create_time` timestamp NOT NULL DEFAULT '1980-01-01 00:00:00' ,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
  `base_url_hash_id` varchar(40) DEFAULT NULL ,
  `img_style` tinyint NOT NULL DEFAULT '-1' ,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_spu_sn` (`spu_id`,`sn`,`pdc_size_id`,`template_id`)
) ENGINE=ROCKSDB AUTO_INCREMENT=1942705 DEFAULT CHARSET=utf8mb3

create table ias_m_product_list_image_test like ias_m_product_list_image;
alter table ias_m_product_list_image_test drop key idx_spu_sn;

REPLACE INTO ias_m_product_list_image_test(id,spu_id,sn,pdc_size_id,template_id,img_hash_cal_time,img_url,img_hash_id,img_type,available_tag,is_deleted,create_time,update_time,base_url_hash_id,img_style) VALUES (1943543,'898263707026407453','JX21Q38DC8191401','2','0','2021-12-21 14:11:55','https://xxxxx.com/upload/merchandise/abcedf/615051/2021/0927/49/b7fc1709-52da-4047-9c3f-c647ad373923.jpg','b152a725ae1c555d5afdb194fb760f07','1','0','1','2021-12-21 14:11:55','2021-12-21 14:12:11','fda46b7001b5ae641cf58fde30c04361','0');
Query OK, 1 row affected (0.01 sec)

It is possible that the unique index of the table is corrupted.
I didn’t delete the unique key index this time.

create table ias_m_product_list_image_test_test like ias_m_product_list_image;
REPLACE INTO ias_m_product_list_image_test_test(id,spu_id,sn,pdc_size_id,template_id,img_hash_cal_time,img_url,img_hash_id,img_type,available_tag,is_deleted,create_time,update_time,base_url_hash_id,img_style) VALUES (1943543,'898263707026407453','JX21Q38DC8191401','2','0','2021-12-21 14:11:55','https://xxxxx.com/upload/merchandise/abcedf/615051/2021/0927/49/b7fc1709-52da-4047-9c3f-c647ad373923.jpg','b152a725ae1c555d5afdb194fb760f07','1','0','1','2021-12-21 14:11:55','2021-12-21 14:12:11','fda46b7001b5ae641cf58fde30c04361','0');
Query OK, 1 row affected (0.01 sec)

But in the case of the original table

REPLACE INTO ias_m_product_list_image(id,spu_id,sn,pdc_size_id,template_id,img_hash_cal_time,img_url,img_hash_id,img_type,available_tag,is_deleted,create_time,update_time,base_url_hash_id,img_style) VALUES (1943543,'898263707026407453','JX21Q38DC8191401','2','0','2021-12-21 14:11:55','https://xxxxx.com/upload/merchandise/abcedf/615051/2021/0927/49/b7fc1709-52da-4047-9c3f-c647ad373923.jpg','b152a725ae1c555d5afdb194fb760f07','1','0','1','2021-12-21 14:11:55','2021-12-21 14:12:11','fda46b7001b5ae641cf58fde30c04361','0');

ERROR 1296 (HY000): Got error 1 'NotFound: ' from ROCKSDB

walkaround:
change replace into to insert ignore

Hi, @matthewb Is there any information update? Thanks.

Have you tried dropping the UNIQUE key on the original table and then add it back in order to rebuild it?

Yes, it worked when I rebuilt the Unique key.