Consistency checker

The consistency of a database or a backup can be checked using the check-consistency argument to the neo4j-admin tool. The neo4j-admin tool is located in the bin directory. If checking the consistency of a database, note that it has to be stopped first or else the consistency check will result in an error.

It is not recommended to use an NFS to check the consistency of a database or a backup as this slows the process down significantly.

Syntax

neo4j-admin check-consistency ([--database=<database>] | [--backup=<path>])
                               [--verbose] [--additional-config=<path>]
                               [--check-graph=<true/false>]
                               [--check-indexes=<true/false>]
                               [--check-index-structure=<true/false>]
                               [--check-label-scan-store=<true/false>]
                               [--check-property-owners=<true/false>]
                               [--report-dir=<path>]`

Please note that the following options have been deprecated:

[--check-label-scan-store=<true/false>]
[--check-property-owners=<true/false>]

Values for these settings will be ignored.

Options

Option Default Description

--database

neo4j

Name of database.

--backup

Path to backup to check consistency of. Cannot be used together with --database.

--additional-config

Configuration file to supply additional configuration in.

--verbose

false

Enable verbose output.

--report-dir

.

Directory to write report file in.

--check-graph

true

Perform checks between nodes, relationships, properties, types and tokens.

--check-indexes

true

Perform checks on indexes by comparing content with the store.

--check-index-structure

true

Perform physical structure check on indexes. No comparison with the store takes place.

--check-label-scan-store

true

This option is deprecated and its value will be ignored.

--check-property-owners

false

This option is deprecated and its value will be ignored.

Output

If the consistency checker does not find errors, it will exit cleanly and not produce a report. If the consistency checker finds errors, it will exit with an exit code of 1 and write a report file with a name on the format inconsistencies-YYYY-MM-DD.HH24.MI.SS.report. The location of the report file is the current working directory, or as specified by the parameter report-dir.

Example 1. Run the consistency checker

Run with the --database option to check the consistency of a database. Note that the database must be stopped first.

$neo4j-home> bin/neo4j-admin check-consistency --database=neo4j

2019-11-13 12:42:14.479+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Selected RecordFormat:StandardV4_0[SF4.0.b] record format from store /data/databases/neo4j
2019-11-13 12:42:14.481+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Format not configured for store /data/databases/neo4j. Selected format from the store files: RecordFormat:StandardV4_0[SF4.0.b]
Index structure consistency check
....................  10%
....................  20%
....................  30%
....................  40%
....................  50%
....................  60%
....................  70%
....................  80%
....................  90%
.................... 100%
Full Consistency Check
....................  10%
....................  20%
....................  30%
....................  40%
....................  50%
....................  60%
....................  70%
....................  80%
....................  90%
.Checking node and relationship counts
....................  10%
....................  20%
....................  30%
....................  40%
....................  50%
....................  60%
....................  70%
....................  80%
....................  90%
.................... 100%

Run with the --backup option to check the consistency of a backup.

bin/neo4j-admin check-consistency --backup backup/neo4j-backup

neo4j-admin check-consistency cannot be applied to the Fabric virtual database. It must be run directly on the databases that are part of the Fabric setup.