[MDEV-30428] checksums on multiple servers are not computed equally Created: 2023-01-18  Updated: 2023-05-02

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.5.18
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Marc Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15519 CHECKSUM TABLE gives different result... Confirmed

 Description   

I'm not sure when or where this exactly happens (maybe massive inserts)
But after some time the checksums of tables differ between master and remote.

Issuing a repair table command fixes this issue (temporary).

The table has the option "checksum=1"

I assume the write order of massive inserts differ and therefore the calculation of the checksum is different.



 Comments   
Comment by Sergei Golubchik [ 2023-02-04 ]

What does CHECKSUM TABLE ... EXTENDED show? does it match the value of CHECKSUM .., QUICK?

Comment by Marc [ 2023-02-07 ]

got a new test case:

Type Table B Table M
CHECKSUM TABLE 495100086 491624335
CHECKSUM TABLE QUICK 495100086 491624335
CHECKSUM TABLE EXTENDED 495100086 495100086

so in general the checksum is correct but the quick algorithm has different values.

Comment by Sergei Golubchik [ 2023-02-27 ]

you said, checksum differs between the master and remote. Is it like above? On the master QUICK and EXTENDED have the same value, while on the remote QUICK is different and EXTENDED is the same as on the master?

Comment by Marc [ 2023-02-28 ]

"B" is the master and "M" is the slave (shortcut comes from my machine names )

Comment by Sergei Golubchik [ 2023-03-30 ]

what is the table structure? can you show the output of SHOW CREATE TABLE for it?
What is the server version? Same on the master and the slave?

Comment by Marc [ 2023-03-30 ]

 show create table tblFile\G
*************************** 1. row ***************************
       Table: tblFile
Create Table: CREATE TABLE `tblFile` (
  `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ParentID` int(10) unsigned NOT NULL DEFAULT 0,
  `Filename` varchar(230) NOT NULL DEFAULT '',
  `Extension` varchar(16) DEFAULT NULL,
  `Path` varchar(800) NOT NULL DEFAULT '',
  `IsProtected` tinyint(1) NOT NULL DEFAULT 0,
  `ContentType` enum('','image/*','text/html','text/webedition','text/js','application/json','text/css','text/htaccess','text/plain','folder/document','application/*','application/pdf','text/xml','video/*','audio/*','folder') NOT NULL DEFAULT '',
  `Creation_Date` timestamp NOT NULL DEFAULT current_timestamp(),
  `Mod_Date` timestamp NOT NULL DEFAULT current_timestamp(),
  `Publish_Date` timestamp NULL DEFAULT NULL,
  `UnPublish_Date` timestamp NULL DEFAULT NULL,
  `DocType` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `TemplateID` int(10) unsigned NOT NULL DEFAULT 0,
  `IsDynamic` tinyint(1) NOT NULL DEFAULT 0,
  `IsSearchable` tinyint(1) NOT NULL DEFAULT 0,
  `Category` text DEFAULT NULL,
  `CreatorID` int(10) unsigned NOT NULL DEFAULT 0,
  `ModifierID` int(10) unsigned NOT NULL DEFAULT 0,
  `RestrictOwners` tinyint(1) NOT NULL DEFAULT 0,
  `Owners` tinytext DEFAULT NULL,
  `OwnersReadOnly` text DEFAULT NULL,
  `Language` char(5) NOT NULL DEFAULT '',
  `WebUserID` int(10) unsigned NOT NULL DEFAULT 0,
  `viewType` enum('list','icons') NOT NULL DEFAULT 'list',
  `InGlossar` tinyint(1) NOT NULL DEFAULT 0,
  `urlMap` varchar(100) DEFAULT NULL,
  `Filehash` binary(16) DEFAULT NULL,
  `parseFile` tinyint(1) NOT NULL DEFAULT 0,
  `Text` text GENERATED ALWAYS AS (concat(`Filename`,coalesce(`Extension`,''))) STORED,
  `IsFolder` tinyint(1) GENERATED ALWAYS AS (`ContentType` = 'folder/document') STORED,
  `IsPublished` tinyint(1) GENERATED ALWAYS AS (`Publish_Date` is not null) STORED,
  `IsModified` tinyint(1) GENERATED ALWAYS AS (`Publish_Date` is not null and `Mod_Date` > `Publish_Date`) VIRTUAL,
  `CreationDate` int(10) unsigned GENERATED ALWAYS AS (timestampdiff(SECOND,from_unixtime(0),`Creation_Date`)) VIRTUAL,
  `ModDate` int(10) unsigned GENERATED ALWAYS AS (timestampdiff(SECOND,from_unixtime(0),`Mod_Date`)) VIRTUAL,
  `Published` int(10) unsigned GENERATED ALWAYS AS (ifnull(timestampdiff(SECOND,from_unixtime(0),`Publish_Date`),0)) VIRTUAL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ParentID` (`ParentID`,`Filename`,`Extension`) USING BTREE,
  KEY `WebUserID` (`WebUserID`),
  KEY `TemplateID` (`TemplateID`,`IsDynamic`),
  KEY `Path` (`Path`(250)) USING BTREE,
  KEY `IsFolder` (`IsFolder`),
  KEY `urlMap` (`urlMap`),
  KEY `searchable` (`ParentID`,`IsSearchable`,`IsPublished`),
  KEY `ContentType` (`ContentType`),
  KEY `IsPublished` (`IsPublished`,`TemplateID`)
) ENGINE=Aria AUTO_INCREMENT=202965 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci CHECKSUM=1 PAGE_CHECKSUM=0 ROW_FORMAT=PAGE TRANSACTIONAL=0

Master and slave have the same version: mariadb-10.5.19-1

Generated at Thu Feb 08 10:16:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.