From 017bb6214c78f11961c434774e27f631646eaf69 Mon Sep 17 00:00:00 2001 From: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:31:48 -0800 Subject: [PATCH 1/9] [1.13] Add docs for SQLite name resolver Fixes #3914 Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> --- .../supported-name-resolution/_index.md | 2 +- .../supported-name-resolution/nr-sqlite.md | 51 +++++++++++++++++++ .../supported-state-stores/setup-sqlite.md | 16 +++--- .../components/name_resolution/generic.yaml | 5 ++ 4 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/_index.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/_index.md index 8aa7b193612..59a956ce5b1 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/_index.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/_index.md @@ -3,7 +3,7 @@ type: docs title: "Name resolution provider component specs" linkTitle: "Name resolution" weight: 8000 -description: The supported name resolution providers that interface with Dapr service invocation +description: The supported name resolution providers to enable Dapr service invocation no_list: true --- diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md new file mode 100644 index 00000000000..bef66baa13e --- /dev/null +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -0,0 +1,51 @@ +--- +type: docs +title: "SQLite name resolution provider" +linkTitle: "SQLite" +description: Detailed information on the SQLite name resolution component +--- + +The SQLite name resolution component offers an alternative to mDNS for running Dapr on single-node environments and for local development scenarios. Dapr sidecars part of the cluster store their information in a SQLite database on the local machine. + +> This component is optimized to be used in scenarios where all Dapr instances are running on the same physical machine, where the database is accessed through the same, locally-mounted disk. +> Using the SQLite nameresolver with a database file accessed over the network (including via SMB/NFS) can lead to issues including data corruption, and is not supported. + +## Configuration format + +Name resolution is configured via the [Dapr Configuration]({{< ref configuration-overview.md >}}). + +Within the Configuration YAML, set the `spec.nameResolution.component` property to `"sqlite"`, then pass configuration options in the `spec.nameResolution.configuration` dictionary. + +This is the basic example of a Configuration resource: + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Configuration +metadata: + name: appconfig +spec: + nameResolution: + component: "sqlite" + version: "v1" + configuration: + connectionString: "/home/user/.dapr/nr.db" +``` + +## Spec configuration fields + +When using the SQLite component as name resolver, the `spec.nameResolution.configuration` dictionary contains these options + +| Field | Required | Type | Details | Examples | +|--------------|:--------:|-----:|:---------|----------| +| `connectionString` | Y | `string` | The connection string for the SQLite database. Normally, this is the path to a file on disk, relative to the current working directory, or absolute. | `"nr.db"` (relative to the working directory), `"/home/user/.dapr/nr.db"` | +| `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (e.g. `1500ms` becomes `1s`). Default: `5s` | `"2s"` | +| `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | +| `tableName` | N | `string` | Name of the table where the data is stored. Defaults to `hosts`. | `"hosts"` | +| `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | +| `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | +| `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `800ms` (800 milliseconds) | `"100ms"` | +| `disableWAL` | N | `bool` | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. This is for advanced scenarios only | `true`, `false` | + +## Related links + +- [Service invocation building block]({{< ref service-invocation >}}) diff --git a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md index 381e6bc4a78..fbebf0e5b41 100644 --- a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md @@ -50,14 +50,14 @@ spec: | Field | Required | Details | Example | |--------------------|:--------:|---------|---------| -| `connectionString` | Y | The connection string for the SQLite database. See below for more details. | `"path/to/data.db"`, `"file::memory:?cache=shared"` -| `timeoutInSeconds` | N | Timeout, in seconds, for all database operations. Defaults to `20` | `30` -| `tableName` | N | Name of the table where the data is stored. Defaults to `state`. | `"state"` -| `metadataTableName` | N | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` -| `cleanupInterval` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to clean up rows with an expired TTL. Setting this to values <=0 disables the periodic cleanup. Default: `0` (i.e. disabled) | `"2h"`, `"30m"`, `-1` -| `busyTimeout` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `2s` | `"100ms"`, `"5s"` -| `disableWAL` | N | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. You should set this to `false` if the database is stored on a network file system (e.g. a folder mounted as a SMB or NFS share). This option is ignored for read-only or in-memory databases. | `"100ms"`, `"5s"` -| `actorStateStore` | N | Consider this state store for actors. Defaults to `"false"` | `"true"`, `"false"` +| `connectionString` | Y | The connection string for the SQLite database. See below for more details. | `"path/to/data.db"`, `"file::memory:?cache=shared"` | +| `timeout` | N | Timeout for operations on the database, as a [Go duration](https://pkg.go.dev/time#ParseDuration). Integers are interpreted as number of seconds. Defaults to `20s` | `"30s"`, `30` | +| `tableName` | N | Name of the table where the data is stored. Defaults to `state`. | `"state"` | +| `metadataTableName` | N | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | +| `cleanupInterval` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to clean up rows with an expired TTL. Setting this to values <=0 disables the periodic cleanup. Default: `0` (i.e. disabled) | `"2h"`, `"30m"`, `-1` | +| `busyTimeout` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `2s` | `"100ms"`, `"5s"` | +| `disableWAL` | N | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. You should set this to `false` if the database is stored on a network file system (e.g. a folder mounted as a SMB or NFS share). This option is ignored for read-only or in-memory databases. | `"true"`, `"false"` | +| `actorStateStore` | N | Consider this state store for actors. Defaults to `"false"` | `"true"`, `"false"` | The **`connectionString`** parameter configures how to open the SQLite database. diff --git a/daprdocs/data/components/name_resolution/generic.yaml b/daprdocs/data/components/name_resolution/generic.yaml index 05fce8211f0..1718f2bae1e 100644 --- a/daprdocs/data/components/name_resolution/generic.yaml +++ b/daprdocs/data/components/name_resolution/generic.yaml @@ -3,3 +3,8 @@ state: Alpha version: v1 since: "1.2" +- component: SQLite + link: nr-sqlite + state: Alpha + version: v1 + since: "1.13" From f26884509c58c61fb27dc32f77dbbf4a1d1d4c05 Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:52:15 -0800 Subject: [PATCH 2/9] Apply suggestions from code review Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> --- .../supported-name-resolution/nr-sqlite.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index bef66baa13e..f06e494c5c7 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -5,10 +5,13 @@ linkTitle: "SQLite" description: Detailed information on the SQLite name resolution component --- -The SQLite name resolution component offers an alternative to mDNS for running Dapr on single-node environments and for local development scenarios. Dapr sidecars part of the cluster store their information in a SQLite database on the local machine. +As an alternative to mDNS, the SQLite name resolution component can be used for running Dapr on single-node environments and for local development scenarios. Dapr sidecars that are part of the cluster store their information in a SQLite database on the local machine. -> This component is optimized to be used in scenarios where all Dapr instances are running on the same physical machine, where the database is accessed through the same, locally-mounted disk. -> Using the SQLite nameresolver with a database file accessed over the network (including via SMB/NFS) can lead to issues including data corruption, and is not supported. +{{% alert title="Note" color="primary" %}} + +This component is optimized to be used in scenarios where all Dapr instances are running on the same physical machine, where the database is accessed through the same, locally-mounted disk. +Using the SQLite nameresolver with a database file accessed over the network (including via SMB/NFS) can lead to issues such as data corruption, and is **not supported**. +{{% /alert %}} ## Configuration format @@ -33,12 +36,12 @@ spec: ## Spec configuration fields -When using the SQLite component as name resolver, the `spec.nameResolution.configuration` dictionary contains these options +When using the SQLite component as name resolver, the `spec.nameResolution.configuration` dictionary contains these options: | Field | Required | Type | Details | Examples | |--------------|:--------:|-----:|:---------|----------| | `connectionString` | Y | `string` | The connection string for the SQLite database. Normally, this is the path to a file on disk, relative to the current working directory, or absolute. | `"nr.db"` (relative to the working directory), `"/home/user/.dapr/nr.db"` | -| `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (e.g. `1500ms` becomes `1s`). Default: `5s` | `"2s"` | +| `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | | `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | | `tableName` | N | `string` | Name of the table where the data is stored. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | From 394b3db5350b4d9b5b3ab5592a0ae71e5e07b75e Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:27:12 -0800 Subject: [PATCH 3/9] Update daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md Co-authored-by: Mark Fussell Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> --- .../components-reference/supported-name-resolution/nr-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index f06e494c5c7..7945a3ba2b3 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -36,7 +36,7 @@ spec: ## Spec configuration fields -When using the SQLite component as name resolver, the `spec.nameResolution.configuration` dictionary contains these options: +When using the SQLite name resolver component, the `spec.nameResolution.configuration` dictionary contains these options: | Field | Required | Type | Details | Examples | |--------------|:--------:|-----:|:---------|----------| From 3d303ec5287284892449acff1a34749170eca616 Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Fri, 2 Feb 2024 09:22:34 -0800 Subject: [PATCH 4/9] Update daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md Co-authored-by: Mark Fussell Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> --- .../components-reference/supported-name-resolution/nr-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index 7945a3ba2b3..a5d7cf90d93 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -43,7 +43,7 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | `connectionString` | Y | `string` | The connection string for the SQLite database. Normally, this is the path to a file on disk, relative to the current working directory, or absolute. | `"nr.db"` (relative to the working directory), `"/home/user/.dapr/nr.db"` | | `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | | `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | -| `tableName` | N | `string` | Name of the table where the data is stored. Defaults to `hosts`. | `"hosts"` | +| `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | | `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `800ms` (800 milliseconds) | `"100ms"` | From 9db51739dd5d1e40999ca7168a261e9bd944f0b1 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Fri, 2 Feb 2024 09:46:02 -0800 Subject: [PATCH 5/9] Update daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md Signed-off-by: Mark Fussell --- .../supported-name-resolution/nr-sqlite.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index a5d7cf90d93..08bc16f7703 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -46,7 +46,8 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | -| `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `800ms` (800 milliseconds) | `"100ms"` | +| `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. This is an advanced setting. + - `busyTimeout` controls how locking works in SQLite. With SQLite, writes are exclusive, so every time any app is writing the database is locked. If another app tries to write, it waits up to `busyTimeout` before returning the "database busy" error. However the `timeout` setting controls the timeout for the entire operation. For example if the query "hangs", after the database has acquired the lock (so after busy timeout is cleared), then `timeout` comes into effect. Default: `800ms` (800 milliseconds) | `"100ms"` | | `disableWAL` | N | `bool` | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. This is for advanced scenarios only | `true`, `false` | ## Related links From ca3b62715b561d6f5d60dd8f61e955f3869a0343 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Fri, 2 Feb 2024 09:46:29 -0800 Subject: [PATCH 6/9] Update daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: Mark Fussell --- .../components-reference/supported-name-resolution/nr-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index 08bc16f7703..69bc83c4c9d 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -41,7 +41,7 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | Field | Required | Type | Details | Examples | |--------------|:--------:|-----:|:---------|----------| | `connectionString` | Y | `string` | The connection string for the SQLite database. Normally, this is the path to a file on disk, relative to the current working directory, or absolute. | `"nr.db"` (relative to the working directory), `"/home/user/.dapr/nr.db"` | -| `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | +| `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database, which is used as healthcheck.
Smaller intervals reduce the likelihood of stale data being returned if an application goes offline, but increase the load on the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | | `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | | `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | From a360f653e47d0a934b7c8d54498b849b64f22085 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Fri, 2 Feb 2024 09:51:23 -0800 Subject: [PATCH 7/9] Update nr-sqlite.md Fixed formatting --- .../supported-name-resolution/nr-sqlite.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index 69bc83c4c9d..7457d05fba6 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -46,8 +46,7 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | -| `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. This is an advanced setting. - - `busyTimeout` controls how locking works in SQLite. With SQLite, writes are exclusive, so every time any app is writing the database is locked. If another app tries to write, it waits up to `busyTimeout` before returning the "database busy" error. However the `timeout` setting controls the timeout for the entire operation. For example if the query "hangs", after the database has acquired the lock (so after busy timeout is cleared), then `timeout` comes into effect. Default: `800ms` (800 milliseconds) | `"100ms"` | +| `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. This is an advanced setting.
`busyTimeout` controls how locking works in SQLite. With SQLite, writes are exclusive, so every time any app is writing the database is locked. If another app tries to write, it waits up to `busyTimeout` before returning the "database busy" error. However the `timeout` setting controls the timeout for the entire operation. For example if the query "hangs", after the database has acquired the lock (so after busy timeout is cleared), then `timeout` comes into effect. Default: `800ms` (800 milliseconds) | `"100ms"` | | `disableWAL` | N | `bool` | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. This is for advanced scenarios only | `true`, `false` | ## Related links From 82e72d094ced2a9f62837607d03ff141896bc6fa Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Fri, 2 Feb 2024 09:52:03 -0800 Subject: [PATCH 8/9] Update daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md Signed-off-by: Mark Fussell --- .../components-reference/supported-name-resolution/nr-sqlite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index 7457d05fba6..6af42553ed9 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -44,7 +44,7 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database, which is used as healthcheck.
Smaller intervals reduce the likelihood of stale data being returned if an application goes offline, but increase the load on the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | | `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | | `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | -| `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | +| `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. If the table does not exist, the table is created by Dapr. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | | `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. This is an advanced setting.
`busyTimeout` controls how locking works in SQLite. With SQLite, writes are exclusive, so every time any app is writing the database is locked. If another app tries to write, it waits up to `busyTimeout` before returning the "database busy" error. However the `timeout` setting controls the timeout for the entire operation. For example if the query "hangs", after the database has acquired the lock (so after busy timeout is cleared), then `timeout` comes into effect. Default: `800ms` (800 milliseconds) | `"100ms"` | | `disableWAL` | N | `bool` | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. This is for advanced scenarios only | `true`, `false` | From 8e32a28364be506ea80d0254c84450045ff9deb9 Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:09:15 -0800 Subject: [PATCH 9/9] Apply suggestions from code review Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com> --- .../components-reference/supported-name-resolution/nr-sqlite.md | 2 +- .../components-reference/supported-state-stores/setup-sqlite.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md index 6af42553ed9..0be4e186036 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/nr-sqlite.md @@ -43,7 +43,7 @@ When using the SQLite name resolver component, the `spec.nameResolution.configur | `connectionString` | Y | `string` | The connection string for the SQLite database. Normally, this is the path to a file on disk, relative to the current working directory, or absolute. | `"nr.db"` (relative to the working directory), `"/home/user/.dapr/nr.db"` | | `updateInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval for active Dapr sidecars to update their status in the database, which is used as healthcheck.
Smaller intervals reduce the likelihood of stale data being returned if an application goes offline, but increase the load on the database.
Must be at least 1s greater than `timeout`. Values with fractions of seconds are truncated (for example, `1500ms` becomes `1s`). Default: `5s` | `"2s"` | | `timeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`).
Must be at least 1s. | Timeout for operations on the database. Integers are interpreted as number of seconds. Defaults to `1s` | `"2s"`, `2` | -| `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exists, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | +| `tableName` | N | `string` | Name of the table where the data is stored. If the table does not exist, the table is created by Dapr. Defaults to `hosts`. | `"hosts"` | | `metadataTableName` | N | `string` | Name of the table used by Dapr to store metadata for the component. If the table does not exist, the table is created by Dapr. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to remove stale records from the database. Default: `1h` (1 hour) | `"10m"` | | `busyTimeout` | N | [Go duration](https://pkg.go.dev/time#ParseDuration) (as a `string`) | Interval to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. This is an advanced setting.
`busyTimeout` controls how locking works in SQLite. With SQLite, writes are exclusive, so every time any app is writing the database is locked. If another app tries to write, it waits up to `busyTimeout` before returning the "database busy" error. However the `timeout` setting controls the timeout for the entire operation. For example if the query "hangs", after the database has acquired the lock (so after busy timeout is cleared), then `timeout` comes into effect. Default: `800ms` (800 milliseconds) | `"100ms"` | diff --git a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md index fbebf0e5b41..c043398d101 100644 --- a/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md +++ b/daprdocs/content/en/reference/components-reference/supported-state-stores/setup-sqlite.md @@ -56,7 +56,7 @@ spec: | `metadataTableName` | N | Name of the table used by Dapr to store metadata for the component. Defaults to `metadata`. | `"metadata"` | | `cleanupInterval` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to clean up rows with an expired TTL. Setting this to values <=0 disables the periodic cleanup. Default: `0` (i.e. disabled) | `"2h"`, `"30m"`, `-1` | | `busyTimeout` | N | Interval, as a [Go duration](https://pkg.go.dev/time#ParseDuration), to wait in case the SQLite database is currently busy serving another request, before returning a "database busy" error. Default: `2s` | `"100ms"`, `"5s"` | -| `disableWAL` | N | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. You should set this to `false` if the database is stored on a network file system (e.g. a folder mounted as a SMB or NFS share). This option is ignored for read-only or in-memory databases. | `"true"`, `"false"` | +| `disableWAL` | N | If set to true, disables Write-Ahead Logging for journaling of the SQLite database. You should set this to `false` if the database is stored on a network file system (for example, a folder mounted as a SMB or NFS share). This option is ignored for read-only or in-memory databases. | `"true"`, `"false"` | | `actorStateStore` | N | Consider this state store for actors. Defaults to `"false"` | `"true"`, `"false"` | The **`connectionString`** parameter configures how to open the SQLite database.