Skip to content

chore: updates for SQLite database #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions advanced/option-database-tuning.rst

This file was deleted.

63 changes: 6 additions & 57 deletions includes/env-vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ STTRACE
Main and operational facilities:
config
Configuration loading and saving.
db
The database layer.
main
Main package.
model
Expand Down Expand Up @@ -51,6 +49,8 @@ STTRACE
REST API.
sha256
SHA256 hashing package (this facility currently unused).
sqlite
The SQLite database
stats
Persistent device and folder statistics.
sync
Expand All @@ -63,65 +63,14 @@ STTRACE
all
All of the above.

STBLOCKPROFILE
Write block profiles to ``block-$pid-$timestamp.pprof`` every 20 seconds.

STCPUPROFILE
Write a CPU profile to ``cpu-$pid.pprof`` on exit.

STDEADLOCKTIMEOUT
Used for debugging internal deadlocks; sets debug sensitivity. Use only
under direction of a developer.

STLOCKTHRESHOLD
Used for debugging internal deadlocks; sets debug sensitivity. Use only
under direction of a developer.

STGUIADDRESS
Override GUI listen address. Equivalent to passing :option:`--gui-address`.

STGUIAPIKEY
Override the API key needed to access the GUI / REST API. Equivalent to
passing :option:`--gui-apikey`.

STGUIASSETS
Directory to load GUI assets from. Overrides compiled in assets. Useful for
developing webgui, commonly use ``STGUIASSETS=gui bin/syncthing``.

STHEAPPROFILE
Write heap profiles to ``heap-$pid-$timestamp.pprof`` each time heap usage
increases.

STNODEFAULTFOLDER
Don't create a default folder when starting for the first time. This
variable will be ignored anytime after the first run. Equivalent to the
:option:`--no-default-folder` flag.

STNORESTART
Equivalent to the :option:`--no-restart` flag.

STNOUPGRADE
Disable automatic upgrades. Equivalent to the :option:`--no-upgrade` flag.

STPROFILER
Set to a listen address such as "127.0.0.1:9090" to start the profiler with
HTTP access, which then can be reached at
http://localhost:9090/debug/pprof. See ``go tool pprof`` for more
information.

STPERFSTATS
Write running performance statistics to ``perf-$pid.csv``. Not supported on
Windows.

STRECHECKDBEVERY
Time before folder statistics (file, dir, ... counts) are recalculated from
scratch. The given duration must be parseable by Go's ``time.ParseDuration``. If
missing or not parseable, the default value of 1 month is used. To force
recalculation on every startup, set it to ``1s``.

STGCINDIRECTEVERY
Sets the time interval in between database garbage collection runs. The
given duration must be parseable by Go's ``time.ParseDuration``.
STVERSIONEXTRA
Add extra information to the version string in logs and the version line
in the GUI. Can be set to the name of a wrapper or tool controlling
syncthing to communicate this to the end user.

GOMAXPROCS
Set the maximum number of CPU cores to use. Defaults to all available CPU
Expand Down
1 change: 0 additions & 1 deletion rest/system-config-get.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ Returns the current configuration.
"stunServers": [
"default"
],
"databaseTuning": "auto",
"maxConcurrentIncomingRequestKiB": 0,
"announceLANAddresses": true,
"sendFullIndexOnUpgrade": false,
Expand Down
2 changes: 1 addition & 1 deletion rest/system-paths-get.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and others.
"certFile": "/home/user/.config/syncthing/cert.pem",
"config": "/home/user/.config/syncthing/config.xml",
"csrfTokens": "/home/user/.config/syncthing/csrftokens.txt",
"database": "/home/user/.local/share/syncthing/index-v0.14.0.db",
"database": "/home/user/.local/share/syncthing/index-v2.db",
"defFolder": "/home/user/Sync",
"guiAssets": "/home/user/src/syncthing/gui",
"httpsCertFile": "/home/user/.config/syncthing/https-cert.pem",
Expand Down
13 changes: 2 additions & 11 deletions users/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ corresponding environment variables (``$STDATADIR`` or ``STHOMEDIR``).
The database directory contains the following files, among others:

:file:`index-{*}.db`
A directory holding the database with metadata and hashes of the files
currently on disk and available from peers.
The database with metadata and hashes of the files currently on disk and
available from peers.

:file:`syncthing.log`
Log output, on some systems.
Expand Down Expand Up @@ -188,7 +188,6 @@ The following shows an example of a default configuration file (IDs will differ)
<stunKeepaliveStartS>180</stunKeepaliveStartS>
<stunKeepaliveMinS>20</stunKeepaliveMinS>
<stunServer>default</stunServer>
<databaseTuning>auto</databaseTuning>
<maxConcurrentIncomingRequestKiB>0</maxConcurrentIncomingRequestKiB>
<announceLANAddresses>true</announceLANAddresses>
<sendFullIndexOnUpgrade>false</sendFullIndexOnUpgrade>
Expand Down Expand Up @@ -1048,7 +1047,6 @@ Options Element
<stunKeepaliveStartS>180</stunKeepaliveStartS>
<stunKeepaliveMinS>20</stunKeepaliveMinS>
<stunServer>default</stunServer>
<databaseTuning>auto</databaseTuning>
<maxConcurrentIncomingRequestKiB>0</maxConcurrentIncomingRequestKiB>
<announceLANAddresses>true</announceLANAddresses>
<sendFullIndexOnUpgrade>false</sendFullIndexOnUpgrade>
Expand Down Expand Up @@ -1300,13 +1298,6 @@ The ``options`` element contains all other global configuration options.
feature. Set ``false`` to keep Syncthing from sending panic logs on serious
troubles. Defaults to ``true``, to help the developers troubleshoot.

.. option:: options.databaseTuning

Controls how Syncthing uses the backend key-value database that stores the
index data and other persistent data it needs. The available options and
implications are explained in a :doc:`separate chapter
</advanced/option-database-tuning>`.

.. option:: options.maxConcurrentIncomingRequestKiB

This limits how many bytes we have "in the air" in the form of response data
Expand Down
4 changes: 2 additions & 2 deletions users/syncing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ version of the file. This version is called the *global* version and is the
one that each device strives to be up to date with.

This information is kept in the *index database*, which is stored in the
configuration directory and called ``index-vx.y.z.db`` (for some version
x.y.z which may not be exactly the version of Syncthing you're running).
configuration or data directory and called ``index-*.db``, with some version
number in place of the asterisk.

When new index data is received from other devices Syncthing recalculates
which version for each file should be the global version, and compares this
Expand Down
Loading