alibaba / alibaba/AliSQL

Corrupt database file

Open
#157 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6k
Forks
902
PR merge metrics
No merged PRs in 30d

Description

Import MySQL data into AliSQL. During queries, some data files were found to be corrupted. The query statement is as follows:
root[database]> select count(*) from h_record where time > '2025-04-01' and time < '2025-04-10';
+----------+
| count(*) |
+----------+
| 3061512 |
+----------+
1 row in set (0.02 sec)

root[database]> select count(*) from h_record where time > '2025-04-11' and time < '2025-04-12';
ERROR 7501 (HY000): [DuckDB] IO Error: Corrupt database file: computed checksum 7085340976184504599 does not match stored checksum 6666362943038018993 in block at location 359883091968.
root[database]> select count(*) from h_record where time > '2025-04-12' and time < '2025-04-13';
ERROR 7501 (HY000): [DuckDB] IO Error: Corrupt database file: computed checksum 7085340976184504599 does not match stored checksum 6666362943038018993 in block at location 359883091968.

How does this kind of problem occur, and how to resolve or prevent it?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the shown SELECT queries against the imported database and inspect the reported DuckDB corrupt database file error at block location 359883091968. Trace the MySQL-to-AliSQL import path to determine how the checksum mismatch can occur; done means documenting a confirmed cause and a practical resolution or prevention procedure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, mysql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.