Arango-dfdb Examples

ArangoDB uses append-only journals. Data corruption should only occur when thedatabase server is killed. In this case, the corruption should only occur in thelast object(s) that have being written to the journal.

If a corruption occurs within a normal datafile, then this can only happen if ahardware fault occurred.

If a journal or datafile is corrupt, shut down the database server and startthe program

  1. arango-dfdb

in order to check the consistency of the datafiles and journals. This brings up

  1. ___ _ __ _ _ ___ ___ ___
  2. / \__ _| |_ __ _ / _(_) | ___ / \/ __\ / _ \
  3. / /\ / _` | __/ _` | |_| | |/ _ \ / /\ /__\// / /_\/
  4. / /_// (_| | || (_| | _| | | __/ / /_// \/ \/ /_\\
  5. /___,' \__,_|\__\__,_|_| |_|_|\___| /___,'\_____/\____/
  6. Available collections:
  7. 0: _structures
  8. 1: _users
  9. 2: _routing
  10. 3: _modules
  11. 4: _graphs
  12. 5: products
  13. 6: prices
  14. *: all
  15. Collection to check:

You can now select which database and collection you want to check. After you selected one or all of the collections, a consistency check will be performed.

  1. Checking collection #1: _users
  2. Database
  3. path: /usr/local/var/lib/arangodb
  4. Collection
  5. name: _users
  6. identifier: 82343
  7. Datafiles
  8. # of journals: 1
  9. # of compactors: 1
  10. # of datafiles: 0
  11. Datafile
  12. path: /usr/local/var/lib/arangodb/collection-82343/journal-1065383.db
  13. type: journal
  14. current size: 33554432
  15. maximal size: 33554432
  16. total used: 256
  17. # of entries: 3
  18. status: OK

If there is a problem with one of the datafiles, then the database debugger will print itand prompt for whether to attempt to fix it.

  1. WARNING: The journal was not closed properly, the last entries are corrupted.
  2. This might happen ArangoDB was killed and the last entries were not
  3. fully written to disk.
  4. Wipe the last entries (Y/N)?

If you answer Y, the corrupted entry will be removed.

If you see a corruption in a datafile (and not a journal), then something isterribly wrong. These files are immutable and never changed by ArangoDB. Acorruption in such file is an indication of a hard-disk failure.