Repairing Data
For the Unique Key Merge on Write table, there are bugs in some Doris versions, which may cause errors when the system calculates the delete bitmap, resulting in duplicate primary keys. At this time, the full compaction function can be used to repair the data. This function is invalid for non-Unique Key Merge on Write tables.
This feature requires Doris version 2.0+.
To use this function, it is necessary to stop the import as much as possible, otherwise problems such as import timeout may occur.
Brief principle explanation
After the full compaction is executed, the delete bitmap will be recalculated, and the wrong delete bitmap data will be deleted to complete the data restoration.
Instructions for use
POST /api/compaction/run?tablet_id={int}&compact_type=full
or
POST /api/compaction/run?table_id={int}&compact_type=full
Note that only one tablet_id and table_id can be specified, and cannot be specified at the same time. After specifying table_id, full_compaction will be automatically executed for all tablets under this table.
Example of use
curl -X POST "http://127.0.0.1:8040/api/compaction/run?tablet_id=10015&compact_type=full"
curl -X POST "http://127.0.0.1:8040/api/compaction/run?table_id=10104&compact_type=full"