Ok, the 1st version of this command is done, pushed in master, and it will be released with 21.12.1. I suggest running CHECK DATABASE without the FIX option first to have a report about any issues found.
We need more tests by simulating more broken databases (not that easy).
Executes an integrity check and in case of a repair of the database. This command analyzes the following things:
- buckets: all the pages and records are scanned and checked if can be loaded (no physical corruption)
- vertices: all the vertices are loaded and all the connected edges are checked. In case some edges point to records that have been
deleted they can be fixed automatically if the FIX option is enabled.
- edges: scan all the edges and check the incoming and outgoing links are consistent in the relative vertices. If not, the edges can
be automatically removed if the FIX option is enabled.
Syntax
CHECK DATABASE [ TYPE <type-name>[,]* ] [ BUCKET <bucket-name>[,]* ] [ FIX ]
<type-name> Optional, if specified limit the check (and the fix) only to the specific types
<bucket-name> Optional, if specified limit the check (and the fix) only to the specific buckets
FIX Optional, if defined auto fix the issue found with the check
The command returns the integrity check report in one record.
Examples
- Execute the integrity check of the entire database without fixing any issue found.
- Execute the integrity check of the types 'Account' and 'Bill' without fixing any issue found.
ArcadeDB> CHECK DATABASE BUCKET "Account", "Bill"
- Execute the integrity check of the entire database and auto-fix any issues found.
ArcadeDB> CHECK DATABASE FIX
Official docs are updated with this new command: https://docs.arcadedb.com/#SQL-Check-Database.