Skip to content

Commit eacd374

Browse files
authored
chore: clarify database resetting options (#1013)
The `--reset-deltas` and `--reset-database` options were removed in Syncthing v2. Fix leftover references and in the process, document the current `syncthing debug ...` subcommand group, where `reset-database` now lives. * Stop referring to removed --reset-deltas option. * Describe debug subcommand similar to the cli hierarchy. Clarify that "cli debug" commands do not require Syncthing to be stopped, while in fact removing the database completely should not be done while it is running. Point to the corresponding API endpoint /rest/system/reset for more granular DB reset functionality. * Add a label for the reset-database subcommand. Currently not used as a target anywhere, but might prove useful for a future FAQ. Add the includes top-level directory to the exclusion list for Sphinx. Documents in there are always used via an include:: directive, so processing them as (unreachable) standalone documents leads to duplicate label warnings. * Fix obsolete reference to --reset-database option. The cautionary note was removed in v2 together with the whole option. Resurrect the text from the old option doc. Signed-off-by: André Colomb <src@andre.colomb.de>
1 parent a59b729 commit eacd374

6 files changed

Lines changed: 34 additions & 10 deletions

File tree

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292

9393
# List of patterns, relative to source directory, that match files and
9494
# directories to ignore when looking for source files.
95-
exclude_patterns = ['_build', '_syncthing', 'draft', 'README.rst', 'users/faq-parts']
95+
exclude_patterns = ['_build', '_syncthing', 'draft', 'README.rst', 'users/faq-parts', 'includes']
9696

9797
# The reST default role (used for this markup: `text`) to use for all
9898
# documents.

includes/cli-commands.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ errors
2424

2525
debug
2626
Various tools to aid in diagnosing problems or collection information for
27-
bug reports. Some of these commands access the database directly and can
28-
therefore only work when Syncthing is not running.
27+
bug reports.
2928

3029
``-`` (a single dash)
3130
Reads subsequent commands from the standard input stream, without needing to

includes/debug-commands.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. _reset-database:
2+
3+
debug reset-database
4+
Reset the database, forcing a full rescan and resync. **Must only be used
5+
when Syncthing is not running.** More granular reset operations are
6+
available on the REST API while Syncthing is running:
7+
:doc:`../rest/system-reset-post`
8+
9+
debug database-statistics
10+
Display database size statistics.
11+
12+
debug database-counts
13+
Display database folder counts.
14+
15+
debug database-file
16+
Display database file metadata.

rest/system-reset-post.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ information for that folder will be erased:
1010
1111
curl -X POST -H "X-API-Key: abc123" http://localhost:8384/rest/system/reset?folder=ab1c2-def3g
1212
13-
**Caution**: See :option:`--reset-database` for ``.stfolder`` creation
14-
side-effect and caution regarding mountpoints.
13+
Creates ``.stfolder`` folders in each sync folder if they do not already exist.
14+
**Caution**: Ensure that all sync folders which are mountpoints are already
15+
mounted. Inconsistent versions may result if the mountpoint is later mounted
16+
and contains older versions.

users/config.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,11 +1337,10 @@ The ``options`` element contains all other global configuration options.
13371337

13381338
.. option:: options.sendFullIndexOnUpgrade
13391339

1340-
Controls whether all index data is resent when an upgrade has happened,
1341-
equivalent to starting Syncthing with :option:`--reset-deltas`. This used
1342-
to be the default behavior in older versions, but is mainly useful as a
1343-
troubleshooting step and causes high database churn. The default is now
1344-
``false``.
1340+
Controls whether all index data is resent when an upgrade has happened.
1341+
This used to be the default behavior in older versions, but is mainly useful
1342+
as a troubleshooting step and causes high database churn. The default is
1343+
now ``false``.
13451344

13461345
.. option:: options.featureFlag
13471346
:aliases: options.featureFlags

users/syncthing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ saves the hassle of handling HTTP connections and API authentication.
323323

324324
.. include:: ../includes/cli-commands.rst
325325

326+
For troubleshooting issues, the ``debug`` subcommand provides some commonly
327+
needed actions for data analysis and repair. Some of these commands access the
328+
database directly and can therefore only work when Syncthing is not running.
329+
Not to be confused with the ``cli debug`` subcommand group, which works via the
330+
REST API.
331+
332+
.. include:: ../includes/debug-commands.rst
333+
326334
Proxies
327335
-------
328336

0 commit comments

Comments
 (0)