diff --git a/docs/references/server-config.mdx b/docs/references/server-config.mdx index 816fbd8..12d8f5a 100644 --- a/docs/references/server-config.mdx +++ b/docs/references/server-config.mdx @@ -8,359 +8,317 @@ import Intro from "/snippets/common/default-configuration.mdx" - - Worker options + + Worker options: + - - Internal queue for partition processor communication + + Internal queue for partition processor communication: + - - The number of timers in memory limit is used to bound the amount of timers loaded in memory. If this limit is set, when exceeding it, the timers farther in the future will be spilled to disk. + + Num timers in memory limit: The number of timers in memory limit is used to bound the amount of timers loaded in memory. If this limit is set, when exceeding it, the timers farther in the future will be spilled to disk. + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Cleanup interval: In order to clean up completed invocations, that is invocations invoked with an idempotency id, or workflows, Restate periodically scans among the completed invocations to check whether they need to be removed or not. This interval sets the scan interval of the cleanup procedure. Default: 1 hour. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Storage options + + Storage options: + - + How many partitions to divide memory across? By default this uses the value defined in `default-num-partitions` in the common section of the config. + - + The memory budget for rocksdb memtables in bytes The total is divided evenly across partitions. The divisor is defined in `num-partitions-to-share-memory-budget`. If this value is set, it overrides the ratio defined in `rocksdb-memory-ratio`. - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - + The memory budget for rocksdb memtables as ratio This defines the total memory for rocksdb as a ratio of all memory available to memtables (See `rocksdb-total-memtables-ratio` in common). The budget is then divided evenly across partitions. The divisor is defined in `num-partitions-to-share-memory-budget` + - - Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + + Disable Direct IO for reads: Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + - - Use O_DIRECT for writes in background flush and compactions. + + Disable Direct IO for flush and compactions: Use O_DIRECT for writes in background flush and compactions. + - - The default depends on the different rocksdb use-cases at Restate. + + Disable WAL: The default depends on the different rocksdb use-cases at Restate. Supports hot-reloading (Partial / Bifrost only) + - + Disable rocksdb statistics collection Default: False (statistics enabled) - - - Default: the number of CPU cores on this node. - - If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - - - Non-zero human-readable bytes - + + RocksDB max background jobs (flushes and compactions): Default: the number of CPU cores on this node. - - + - + + RocksDB compaction readahead size in bytes: If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. + + Non-zero human-readable bytes - - StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. + + RocksDB statistics level: StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. Default: \"except-detailed-timers\" + - - - - - - Disable all metrics - + - `"disable-all"` : Disable all metrics + - `"except-histogram-or-timers"` : Disable timer stats, and skip histogram stats + - `"except-timers"` : Skip timer stats + - `"except-detailed-timers"` : Collect all stats except time inside mutex lock AND time spent on compression. + - `"except-time-for-mutex"` : Collect all stats except the counters requiring to get time inside the mutex lock. + - `"all"` : Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. + - - Disable timer stats, and skip histogram stats - + + RocksDB log level: Verbosity of the LOG. - - Skip timer stats - +Default: \"error\" - - Collect all stats except time inside mutex lock AND time spent on compression. - + Verbosity of the LOG. + - - Collect all stats except the counters requiring to get time inside the mutex lock. - + + RocksDB log keep file num: Number of info LOG files to keep - - Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - +Default: 1 - - + - - + + RocksDB log max file size: Max size of info LOG file - - +Default: 64MB - - Verbosity of the LOG. + Non-zero human-readable bytes + -Default: \"error\" - - - - Verbosity of the LOG. - + + RocksDB block size: Uncompressed block size - - +Default: 64KiB - + Non-zero human-readable bytes - - Number of info LOG files to keep + + + + + Invoker options: -Default: 1 - + + + + Retry policy: This is **deprecated** and will be removed in the next Restate releases. - - Max size of info LOG file +Please refer to `default-retry-policy` for the new configuration options. -Default: 64MB - - - Non-zero human-readable bytes - + + + No retry strategy. + + + + +Set `type: "none"` - - + + + Retry with a fixed delay strategy. - - Uncompressed block size + + + +Set `type: "fixed-delay"` -Default: 64KiB - - - - Non-zero human-readable bytes - + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - + - - Invoker options - - - - Definition of a retry policy + - - - No retry strategy. + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. + + - - - - +Set `type: "exponential"` + - - Retry with a fixed delay strategy. - - - - + + Initial Interval: Initial interval for the first retry attempt. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - Number of maximum attempts before giving up. Infinite retries if unset. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Factor: The factor to use to compute the next retry attempt. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Number of maximum attempts before giving up. Infinite retries if unset. - + - - Maximum interval between retries. + + Max interval: Maximum interval between retries. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - - - - + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - + Non-zero human-readable bytes - - - Threshold to fail the invocation in case protocol messages coming from a service are larger than the specified amount. - - - - Non-zero human-readable bytes - + - - + + Message size limit: Threshold to fail the invocation in case protocol messages coming from a service are larger than the specified amount. - + Non-zero human-readable bytes - + Temporary directory to use for the invoker temporary files. If empty, the system temporary directory will be used instead. + - - Defines the threshold after which queues invocations will spill to disk at the path defined in `tmp-dir`. In other words, this is the number of invocations that can be kept in memory before spilling to disk. This is a per-partition limit. + + Spill invocations to disk: Defines the threshold after which queues invocations will spill to disk at the path defined in `tmp-dir`. In other words, this is the number of invocations that can be kept in memory before spilling to disk. This is a per-partition limit. + - - Number of concurrent invocations that can be processed by the invoker. + + Limit number of concurrent invocations from this node: Number of concurrent invocations that can be processed by the invoker. + - - Configures throttling for service invocations at the node level. This throttling mechanism uses a token bucket algorithm to control the rate at which invocations can be processed, helping to prevent resource exhaustion and maintain system stability under high load. + + Invocation throttling: Configures throttling for service invocations at the node level. This throttling mechanism uses a token bucket algorithm to control the rate at which invocations can be processed, helping to prevent resource exhaustion and maintain system stability under high load. The throttling limit is shared across all partitions running on this node, providing a global rate limit for the entire node rather than per-partition limits. When `unset`, no throttling is applied and invocations are processed without throttling. - - - - Throttling options per invoker. - - - - The rate at which the tokens are replenished. -Syntax: `/` where `` is `s|sec|second`, `m|min|minute`, or `h|hr|hour`. unit defaults to per second if not specified. - + Throttling options per invoker. + + + + Refill rate: The rate at which the tokens are replenished. - - The maximum number of tokens the bucket can hold. Default to the rate value if not specified. - +Syntax: `<rate>/<unit>` where `<unit>` is `s|sec|second`, `m|min|minute`, or `h|hr|hour`. unit defaults to per second if not specified. - - + + Burst capacity: The maximum number of tokens the bucket can hold. Default to the rate value if not specified. + - - Configures rate limiting for service actions at the node level. This throttling mechanism uses a token bucket algorithm to control the rate at which actions can be processed, helping to prevent resource exhaustion and maintain system stability under high load. + + Action throttling: Configures rate limiting for service actions at the node level. This throttling mechanism uses a token bucket algorithm to control the rate at which actions can be processed, helping to prevent resource exhaustion and maintain system stability under high load. The throttling limit is shared across all partitions running on this node, providing a global rate limit for the entire node rather than per-partition limits. When `unset`, no throttling is applied and actions are processed without throttling. - - - - Throttling options per invoker. - - - - The rate at which the tokens are replenished. -Syntax: `/` where `` is `s|sec|second`, `m|min|minute`, or `h|hr|hour`. unit defaults to per second if not specified. - + Throttling options per invoker. + + + + Refill rate: The rate at which the tokens are replenished. - - The maximum number of tokens the bucket can hold. Default to the rate value if not specified. - +Syntax: `<rate>/<unit>` where `<unit>` is `s|sec|second`, `m|min|minute`, or `h|hr|hour`. unit defaults to per second if not specified. - - + + Burst capacity: The maximum number of tokens the bucket can hold. Default to the rate value if not specified. + @@ -369,129 +327,155 @@ Syntax: `/` where `` is `s|sec|second`, `m|min|minute`, or `h| - - The maximum number of commands a partition processor will apply in a batch. The larger this value is, the higher the throughput and latency are. + + Maximum command batch size for partition processors: The maximum number of commands a partition processor will apply in a batch. The larger this value is, the higher the throughput and latency are. + - - Partition store snapshotting settings. At a minimum, set `destination` and `snapshot-interval-num-records` to enable snapshotting. For a complete example, see [Snapshots](https://docs.restate.dev/operate/snapshots). + + Snapshots provide a mechanism for safely trimming the log and efficient bootstrapping of new worker nodes. + - - Base URL for cluster snapshots. Supports `s3://` and `file://` protocol scheme. S3-compatible object stores must support ETag-based conditional writes. + + Snapshot destination URL: Base URL for cluster snapshots. Supports `s3://` and `file://` protocol scheme. S3-compatible object stores must support ETag-based conditional writes. Default: `None` + - - Number of log records that trigger a snapshot to be created. + + Automatic snapshot creation frequency: Number of log records that trigger a snapshot to be created. As snapshots are created asynchronously, the actual number of new records that will trigger a snapshot will vary. The counter for the subsequent snapshot begins from the LSN at which the previous snapshot export was initiated. Only leader Partition Processors will take snapshots for a given partition. This setting does not influence explicitly requested snapshots triggered using `restatectl`. Default: `None` - automatic snapshots are disabled + - - Definition of a retry policy + + Error retry policy: A retry policy for dealing with retryable object store errors. + - - - No retry strategy. + + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. + + + + Retry with a fixed delay strategy. + + - - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + +Set `type: "exponential"` + + - - Maximum interval between retries. + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + - + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - The AWS configuration profile to use for S3 object store destinations. If you use named profiles in your AWS configuration, you can replace all the other settings with a single profile reference. See the [AWS documentation on profiles] (https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) for more. + + AWS profile: The AWS configuration profile to use for S3 object store destinations. If you use named profiles in your AWS configuration, you can replace all the other settings with a single profile reference. See the [AWS documentation on profiles] (https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) for more. + - + AWS region to use with S3 object store destinations. This may be inferred from the environment, for example the current region when running in EC2. Because of the request signing algorithm this must have a value. For Minio, you can generally set this to any string, such as `us-east-1`. + - - Username for Minio, or consult the service documentation for other S3-compatible stores. + + AWS access key: Username for Minio, or consult the service documentation for other S3-compatible stores. + - - Password for Minio, or consult the service documentation for other S3-compatible stores. + + AWS secret key: Password for Minio, or consult the service documentation for other S3-compatible stores. + - - This is only needed with short-term STS session credentials. + + AWS session token: This is only needed with short-term STS session credentials. + - - When you use Amazon S3, this is typically inferred from the region and there is no need to set it. With other object stores, you will have to provide an appropriate HTTP(S) endpoint. If *not* using HTTPS, also set `aws-allow-http` to `true`. + + Object store API endpoint URL override: When you use Amazon S3, this is typically inferred from the region and there is no need to set it. With other object stores, you will have to provide an appropriate HTTP(S) endpoint. If *not* using HTTPS, also set `aws-allow-http` to `true`. + - - Allow plain HTTP to be used with the object store endpoint. Required when the endpoint URL that isn't using HTTPS. + + Allow insecure HTTP: Allow plain HTTP to be used with the object store endpoint. Required when the endpoint URL that isn't using HTTPS. + @@ -500,99 +484,123 @@ Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/ - - Admin server options + + Admin server options: + - - Address to bind for the Admin APIs. + + Endpoint address: Address to bind for the Admin APIs. + - - Optional advertised Admin API endpoint. + + Advertised Admin endpoint: Optional advertised Admin API endpoint. + - - List of header names considered routing headers. + + Deployment routing headers: List of header names considered routing headers. These will be used during deployment creation to distinguish between an already existing deployment and a new deployment. + - + - + Concurrency limit for the Admin APIs. Default is unlimited. + - - Storage query engine options + + Storage query engine options: + - + Non-zero human-readable bytes + - - The path to spill to + + Temp folder to use for spill: The path to spill to + - - The degree of parallelism to use for query execution (Defaults to the number of available cores). + + Default query parallelism: The degree of parallelism to use for query execution (Defaults to the number of available cores). + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Controller heartbeats: Controls the interval at which cluster controller polls nodes of the cluster. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - + Disable serving the Restate Web UI on the admin port. Default is `false`. + - + - - Ingress options + + Ingress options: + - - The address to bind for the ingress. + + Bind address: The address to bind for the ingress. + - - Local concurrency limit to use to limit the amount of concurrent requests. If exceeded, the ingress will reply immediately with an appropriate status code. Default is unlimited. + + Concurrency limit: Local concurrency limit to use to limit the amount of concurrent requests. If exceeded, the ingress will reply immediately with an appropriate status code. Default is unlimited. + - + - - Configuration options to connect to a Kafka cluster. + + Kafka cluster options: Configuration options to connect to a Kafka cluster. + - + Cluster name (Used to identify subscriptions). + - - Initial list of brokers (host or host:port). + + Servers: Initial list of brokers (host or host:port). + - + @@ -604,212 +612,261 @@ These will be used during deployment creation to distinguish between an already - + Ingress endpoint that the Web UI should use to interact with. + - - Bifrost options + + Bifrost options: + - - An enum with the list of supported loglet providers. - - - - A local rocksdb-backed loglet. - + + The default kind of loglet to be used: Default: Replicated - - Replicated loglets are restate's native log replication system. This requires `log-server` role to run on enough nodes in the cluster. - - - + + - `"local"` : A local rocksdb-backed loglet. + - `"replicated"` : Replicated loglets are restate's native log replication system. This requires `log-server` role to run on enough nodes in the cluster. - + Configuration of local loglet provider + - + + Configuration of replicated loglet provider + - + Maximum number of inflight records sequencer can accept Once this maximum is hit, sequencer will induce back pressure on clients. This controls the total number of records regardless of how many batches. Note that this will be increased to fit the biggest batch of records being enqueued. + - - Definition of a retry policy - - - - No retry strategy. - - - - + + Retry policy: Sequencer retry policy - - +Backoff introduced when sequencer fail to find a suitable spread of log servers - - Retry with a fixed delay strategy. - - - - + + + + No retry strategy. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + + - - Number of maximum attempts before giving up. Infinite retries if unset. - +Set `type: "none"` - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + + + Retry with a fixed delay strategy. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + + - - The factor to use to compute the next retry attempt. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + - - Maximum interval between retries. + + Interval between retries. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. + + + + +Set `type: "exponential"` + + + + + Initial Interval: Initial interval for the first retry attempt. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + + + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + + + + + + Non-zero human-readable duration: Sequencer inactivity timeout + +The sequencer is allowed to consider itself quiescent if it did not commit records for this period of time. It may use this to sends pre-emptive release/seal check requests to log-servers. + +The sequencer is also allowed to use this value as interval to send seal/release checks even if it's not quiescent. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Non-zero human-readable duration: Log Server RPC timeout + +Timeout waiting on log server response + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Definition of a retry policy + + Log Server RPC retry policy + +Retry policy for log server RPCs + + - - - No retry strategy. + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. + + + + Retry with a fixed delay strategy. + + - - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + +Set `type: "exponential"` + + - - Maximum interval between retries. + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + - + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - + Maximum number of records to prefetch from log servers The number of records bifrost will attempt to prefetch from replicated loglet's log-servers for every loglet reader (e.g. partition processor). Note that this mainly impacts readers that are not co-located with the loglet sequencer (i.e. partition processor followers). + - + Non-zero human-readable bytes + - + Trigger to prefetch more records When read-ahead is used (readahead-records), this value (percentage in float) will determine when readers should trigger a prefetch for another batch to fill up the buffer. For instance, if this value is 0.3, then bifrost will trigger a prefetch when 30% or more of the read-ahead slots become available (e.g. partition processor consumed records and freed up enough slots). @@ -819,650 +876,612 @@ The higher the value is, the longer bifrost will wait before it triggers the nex To illustrate, if readahead-records is set to 100 and readahead-trigger-ratio is 1.0. Then bifrost will prefetch up to 100 records from log-servers and will not trigger the next prefetch unless the consumer consumes 100% of this buffer. This means that bifrost will read in batches but will not do while the consumer is still reading the previous batch. Value must be between 0 and 1. It will be clamped at `1.0`. + - - Definition of a retry policy + + Read retry policy: Retry policy to use when bifrost waits for reconfiguration to complete during read operations + - - - No retry strategy. + + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. + + + + Retry with a fixed delay strategy. + + - - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + +Set `type: "exponential"` + + - - Maximum interval between retries. + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + - + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Seal retry interval: Interval to wait between retries of loglet seal failures + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Auto recovery threshold: Time interval after which bifrost's auto-recovery mechanism will kick in. This is triggered in scenarios where the control plane took too long to complete loglet reconfigurations. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Append retry minimum interval: Minimum retry duration used by the exponential backoff mechanism for bifrost appends. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Append retry maximum interval: Maximum retry duration used by the exponential backoff mechanism for bifrost appends. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Human-readable bytes + + In-memory RecordCache memory limit: Optional size of record cache in bytes. If set to 0, record cache will be disabled. Defaults: 250MB + - - When enabled, automatic improvement periodically checks with the loglet provider if the loglet configuration can be improved by performing a reconfiguration. + + Disable Automatic Improvement: When enabled, automatic improvement periodically checks with the loglet provider if the loglet configuration can be improved by performing a reconfiguration. This allows the log to pick up replication property changes, apply better placement of replicas, or for other reasons. + - - Metadata store options + + Metadata store options: + - + Limit number of in-flight requests Number of in-flight metadata store requests. + - + The memory budget for rocksdb memtables in bytes If this value is set, it overrides the ratio defined in `rocksdb-memory-ratio`. - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - + The memory budget for rocksdb memtables as ratio This defines the total memory for rocksdb as a ratio of all memory available to memtables (See `rocksdb-total-memtables-ratio` in common). + - + Auto join the metadata cluster when being started Defines whether this node should auto join the metadata store cluster when being started for the first time. + - - Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + + Disable Direct IO for reads: Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + - - Use O_DIRECT for writes in background flush and compactions. + + Disable Direct IO for flush and compactions: Use O_DIRECT for writes in background flush and compactions. + - - The default depends on the different rocksdb use-cases at Restate. + + Disable WAL: The default depends on the different rocksdb use-cases at Restate. Supports hot-reloading (Partial / Bifrost only) + - + Disable rocksdb statistics collection Default: False (statistics enabled) - - - Default: the number of CPU cores on this node. - - If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - - - Non-zero human-readable bytes - - - - + + RocksDB max background jobs (flushes and compactions): Default: the number of CPU cores on this node. - - - StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - -Default: \"except-detailed-timers\" - - - - - - - Disable all metrics - - - - Disable timer stats, and skip histogram stats - - - - Skip timer stats - - - - Collect all stats except time inside mutex lock AND time spent on compression. - - - - Collect all stats except the counters requiring to get time inside the mutex lock. - + + RocksDB compaction readahead size in bytes: If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - + Non-zero human-readable bytes + - - + + RocksDB statistics level: StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - - +Default: \"except-detailed-timers\" - + + - `"disable-all"` : Disable all metrics + - `"except-histogram-or-timers"` : Disable timer stats, and skip histogram stats + - `"except-timers"` : Skip timer stats + - `"except-detailed-timers"` : Collect all stats except time inside mutex lock AND time spent on compression. + - `"except-time-for-mutex"` : Collect all stats except the counters requiring to get time inside the mutex lock. + - `"all"` : Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - - Verbosity of the LOG. + + RocksDB log level: Verbosity of the LOG. Default: \"error\" - - - - Verbosity of the LOG. - - - - - + Verbosity of the LOG. - - Number of info LOG files to keep + + RocksDB log keep file num: Number of info LOG files to keep Default: 1 + - - Max size of info LOG file + + RocksDB log max file size: Max size of info LOG file Default: 64MB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - - Uncompressed block size + + RocksDB block size: Uncompressed block size Default: 64KiB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - + The number of ticks before triggering an election The number of ticks before triggering an election. The value must be larger than `raft_heartbeat_tick`. It's recommended to set `raft_election_tick = 10 * raft_heartbeat_tick`. Decrease this value if you want to react faster to failed leaders. Note, decreasing this value too much can lead to cluster instabilities due to falsely detecting dead leaders. + - + The number of ticks before sending a heartbeat A leader sends heartbeat messages to maintain its leadership every heartbeat ticks. Decrease this value to send heartbeats more often. + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Non-zero human-readable duration: The raft tick interval + +The interval at which the raft node will tick. Decrease this value in order to let the Raft node react more quickly to changes. Note, that every tick comes with an overhead. Moreover, the tick interval directly affects the election timeout. If the election timeout becomes too small, then this can cause cluster instabilities due to frequent leader changes. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Non-zero human-readable duration: The status update interval + +The interval at which the raft node will update its status. Decrease this value in order to see more recent status updates. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - The threshold for trimming the raft log. The log will be trimmed if the number of apply entries exceeds this threshold. The default value is `1000`. + + The raft log trim threshold: The threshold for trimming the raft log. The log will be trimmed if the number of apply entries exceeds this threshold. The default value is `1000`. + - - Common network configuration options for communicating with Restate cluster nodes. Note that similar keys are present in other config sections, such as in Service Client options. + + Networking options: Common network configuration options for communicating with Restate cluster nodes. Note that similar keys are present in other config sections, such as in Service Client options. + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Connect timeout: TCP connection timeout for Restate cluster node-to-node network connections. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Definition of a retry policy + + Connect retry policy: Retry policy to use for internal node-to-node networking. + - - - No retry strategy. + + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. - - - - + + + + Retry with a fixed delay strategy. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + + - - Number of maximum attempts before giving up. Infinite retries if unset. - +Set `type: "fixed-delay"` - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Interval between retries. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - The factor to use to compute the next retry attempt. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Number of maximum attempts before giving up. Infinite retries if unset. - + - - Maximum interval between retries. + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. + + + + +Set `type: "exponential"` + + + + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + + + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Handshake timeout: Timeout for receiving a handshake response from Restate cluster peers. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + HTTP/2 Keep Alive Interval: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + HTTP/2 Keep Alive Timeout: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - HTTP/2 Adaptive Window + + HTTP/2 Adaptive Window: + - - Disables Zstd compression for internal gRPC network connections + + Disable Compression: Disables Zstd compression for internal gRPC network connections + - + Non-zero human-readable bytes + - - Configuration is only used on nodes running with `log-server` role. + + Log server options: Configuration is only used on nodes running with `log-server` role. + - + The memory budget for rocksdb memtables in bytes If this value is set, it overrides the ratio defined in `rocksdb-memory-ratio`. - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - + The memory budget for rocksdb memtables as ratio This defines the total memory for rocksdb as a ratio of all memory available to the log-server. (See `rocksdb-total-memtables-ratio` in common). + - + Disable fsync of WAL on every batch + - + The maximum number of subcompactions to run in parallel. Setting this to 1 means no sub-compactions are allowed (i.e. only 1 thread will do the compaction). Default is 0 which maps to floor(number of CPU cores / 2) + - - Human-readable bytes + + Human-readable bytes: The size limit of all WAL files + +Use this to limit the size of WAL files. If the size of all WAL files exceeds this limit, the oldest WAL file will be deleted and if needed, memtable flush will be triggered. + +Note: RocksDB internally counts the uncompressed bytes to determine the WAL size, and since the WAL is compressed, the actual size on disk will be significantly smaller than this value (~1/4 depending on the compression ratio). For instance, if this is set to \"1 MiB\", then rocksdb might decide to flush if the total WAL (on disk) reached ~260 KiB (compressed). + +Default is `0` which translates into 6 times the memory allocated for membtables for this database. + - + Trigger a commit when the batch size exceeds this threshold. Set to 0 or 1 to commit the write batch on every command. + - + The number of messages that can queue up on input network stream while request processor is busy. + - - Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + + Disable Direct IO for reads: Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + - - Use O_DIRECT for writes in background flush and compactions. + + Disable Direct IO for flush and compactions: Use O_DIRECT for writes in background flush and compactions. + - - The default depends on the different rocksdb use-cases at Restate. + + Disable WAL: The default depends on the different rocksdb use-cases at Restate. Supports hot-reloading (Partial / Bifrost only) + - + Disable rocksdb statistics collection Default: False (statistics enabled) - - - Default: the number of CPU cores on this node. - - If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - - - Non-zero human-readable bytes - - - - + + RocksDB max background jobs (flushes and compactions): Default: the number of CPU cores on this node. - - - StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - -Default: \"except-detailed-timers\" - - - - - - - Disable all metrics - - - - Disable timer stats, and skip histogram stats - + + RocksDB compaction readahead size in bytes: If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - Skip timer stats - - - - Collect all stats except time inside mutex lock AND time spent on compression. - - - - Collect all stats except the counters requiring to get time inside the mutex lock. - - - - Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - + Non-zero human-readable bytes + - - + + RocksDB statistics level: StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - - +Default: \"except-detailed-timers\" - + + - `"disable-all"` : Disable all metrics + - `"except-histogram-or-timers"` : Disable timer stats, and skip histogram stats + - `"except-timers"` : Skip timer stats + - `"except-detailed-timers"` : Collect all stats except time inside mutex lock AND time spent on compression. + - `"except-time-for-mutex"` : Collect all stats except the counters requiring to get time inside the mutex lock. + - `"all"` : Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - - Verbosity of the LOG. + + RocksDB log level: Verbosity of the LOG. Default: \"error\" - - - - Verbosity of the LOG. - - - - - + Verbosity of the LOG. - - Number of info LOG files to keep + + RocksDB log keep file num: Number of info LOG files to keep Default: 1 + - - Max size of info LOG file + + RocksDB log max file size: Max size of info LOG file Default: 64MB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - - Uncompressed block size + + RocksDB block size: Uncompressed block size Default: 64KiB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - + Defines the roles which this Restate node should run, by default the node starts with all roles. + - + - - - A worker runs partition processor (journal, state, and drives invocations) - - - - Admin runs cluster controller and user-facing admin APIs - - - - Serves the metadata store - - - - Serves a log-server for replicated loglets - - - - Serves HTTP ingress requests - - - + - `"worker"` : A worker runs partition processor (journal, state, and drives invocations) + - `"admin"` : Admin runs cluster controller and user-facing admin APIs + - `"metadata-server"` : Serves the metadata store + - `"log-server"` : Serves a log-server for replicated loglets + - `"http-ingress"` : Serves HTTP ingress requests - - Unique name for this node in the cluster. The node must not change unless it's started with empty local store. It defaults to the node's hostname. + + Node Name: Unique name for this node in the cluster. The node must not change unless it's started with empty local store. It defaults to the node's hostname. + - - [PREVIEW FEATURE] Setting the location allows Restate to form a tree-like cluster topology. The value is written in the format of \"region[.zone]\" to assign this node to a specific region, or to a zone within a region. + + Node Location: [PREVIEW FEATURE] Setting the location allows Restate to form a tree-like cluster topology. The value is written in the format of \"region[.zone]\" to assign this node to a specific region, or to a zone within a region. The value of region and zone is arbitrary but whitespace and `.` are disallowed. @@ -1470,19 +1489,22 @@ NOTE: It's _strongly_ recommended to not change the node's location string after When this value is not set, the node is considered to be in the _default_ location. The _default_ location means that the node is not assigned to any specific region or zone. -## Examples - `us-west` -- the node is in the `us-west` region. - `us-west.a1` -- the node is in the `us-west` region and in the `a1` zone. - `` -- [default] the node is in the default location +Examples - `us-west` -- the node is in the `us-west` region. - `us-west.a1` -- the node is in the `us-west` region and in the `a1` zone. - `` -- [default] the node is in the default location + - + If set, the node insists on acquiring this node ID. + - - A unique identifier for the cluster. All nodes in the same cluster should have the same. + + Cluster name: A unique identifier for the cluster. All nodes in the same cluster should have the same. + - - If true, then this node is allowed to automatically provision as a new cluster. This node *must* have an admin role and a new nodes configuration will be created that includes this node. + + Auto cluster provisioning: If true, then this node is allowed to automatically provision as a new cluster. This node *must* have an admin role and a new nodes configuration will be created that includes this node. auto-provision is allowed by default in development mode and is disabled if restate-server runs with `--production` flag to prevent cluster nodes from forming their own clusters, rather than forming a single cluster. @@ -1491,252 +1513,524 @@ Use `restatectl` to provision the cluster/node if automatic provisioning is disa This can also be explicitly disabled by setting this value to false. Default: true + - + The working directory which this Restate node should use for relative paths. The default is `restate-data` under the current working directory. + - - The metadata client type to store metadata + + Metadata client options: The metadata client type to store metadata + - - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + + + + +Set `type: "replicated"` + + + + + Restate metadata server address list: + + + + + + + + + + + Connect timeout: TCP connection timeout for connecting to the metadata store. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Metadata Store Keep Alive Interval: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Metadata Store Keep Alive Timeout: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Definition of a retry policy + + Backoff policy used by the metadata client when it encounters concurrent modifications. + - - - No retry strategy. + + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. + + + + Retry with a fixed delay strategy. + + - - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + +Set `type: "exponential"` + + - - Maximum interval between retries. + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + + + + Factor: The factor to use to compute the next retry attempt. - + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - - Store metadata on the replicated metadata store that runs on nodes with the metadata-server role. + + - - - - - Restate metadata server address list +Set `type: "etcd"` + + + + + Etcd cluster node address list: + + + + + Connect timeout: TCP connection timeout for connecting to the metadata store. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Metadata Store Keep Alive Interval: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Metadata Store Keep Alive Timeout: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Backoff policy used by the metadata client when it encounters concurrent modifications. + + + + + No retry strategy. + + - - - - +Set `type: "none"` + - + + + Retry with a fixed delay strategy. + + + + +Set `type: "fixed-delay"` + + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + - - Store metadata on an external etcd cluster. + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. -The addresses are formatted as `host:port` + + + - - + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. + + + + +Set `type: "exponential"` + + + + + Initial Interval: Initial interval for the first retry attempt. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - - Etcd cluster node address list + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Store metadata on an external object store. + + + - - - - - This location will be used to persist cluster metadata. Takes the form of a URL with `s3://` as the protocol and bucket name as the authority, plus an optional prefix specified as the path component. +Set `type: "object-store"` + + + + + Object store path for metadata storage: This location will be used to persist cluster metadata. Takes the form of a URL with `s3://` as the protocol and bucket name as the authority, plus an optional prefix specified as the path component. Example: `s3://bucket/prefix` + + + + + Error retry policy: Definition of a retry policy + + + + + No retry strategy. + + + + +Set `type: "none"` + - - Definition of a retry policy + + + + Retry with a fixed delay strategy. + + - - - No retry strategy. - - - - - - +Set `type: "fixed-delay"` - - Retry with a fixed delay strategy. - - - - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. + + + + +Set `type: "exponential"` + + + + + Initial Interval: Initial interval for the first retry attempt. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + + + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + + + + + + + AWS profile: The AWS configuration profile to use for S3 object store destinations. If you use named profiles in your AWS configuration, you can replace all the other settings with a single profile reference. See the [AWS documentation on profiles] (https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) for more. + + + + + AWS region to use with S3 object store destinations. This may be inferred from the environment, for example the current region when running in EC2. Because of the request signing algorithm this must have a value. For Minio, you can generally set this to any string, such as `us-east-1`. + + + + + AWS access key: Username for Minio, or consult the service documentation for other S3-compatible stores. + + + + + AWS secret key: Password for Minio, or consult the service documentation for other S3-compatible stores. + + + + + AWS session token: This is only needed with short-term STS session credentials. + + + + + Object store API endpoint URL override: When you use Amazon S3, this is typically inferred from the region and there is no need to set it. With other object stores, you will have to provide an appropriate HTTP(S) endpoint. If *not* using HTTPS, also set `aws-allow-http` to `true`. + + + + + Allow insecure HTTP: Allow plain HTTP to be used with the object store endpoint. Required when the endpoint URL that isn't using HTTPS. + + + + + Connect timeout: TCP connection timeout for connecting to the metadata store. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Metadata Store Keep Alive Interval: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Metadata Store Keep Alive Timeout: Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + + + + + Backoff policy used by the metadata client when it encounters concurrent modifications. + + + + + No retry strategy. + + + + +Set `type: "none"` + + + + + + + Retry with a fixed delay strategy. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + + - - Number of maximum attempts before giving up. Infinite retries if unset. - +Set `type: "fixed-delay"` - - + - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Interval between retries. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - The factor to use to compute the next retry attempt. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Number of maximum attempts before giving up. Infinite retries if unset. - + - - Maximum interval between retries. + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. -Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - + + - - +Set `type: "exponential"` - - - The AWS configuration profile to use for S3 object store destinations. If you use named profiles in your AWS configuration, you can replace all the other settings with a single profile reference. See the [AWS documentation on profiles] (https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) for more. - + + Initial Interval: Initial interval for the first retry attempt. - - AWS region to use with S3 object store destinations. This may be inferred from the environment, for example the current region when running in EC2. Because of the request signing algorithm this must have a value. For Minio, you can generally set this to any string, such as `us-east-1`. - +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - Username for Minio, or consult the service documentation for other S3-compatible stores. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Password for Minio, or consult the service documentation for other S3-compatible stores. - - This is only needed with short-term STS session credentials. + + Factor: The factor to use to compute the next retry attempt. + - - When you use Amazon S3, this is typically inferred from the region and there is no need to set it. With other object stores, you will have to provide an appropriate HTTP(S) endpoint. If *not* using HTTPS, also set `aws-allow-http` to `true`. + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + - - Allow plain HTTP to be used with the object store endpoint. Required when the endpoint URL that isn't using HTTPS. + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" @@ -1745,16 +2039,18 @@ Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/ - + Address to bind for the Node server. Derived from the advertised address, defaulting to `0.0.0.0:$PORT` (where the port will be inferred from the URL scheme). + - + Address that other nodes will use to connect to this node. Default is `http://127.0.0.1:5122/` + - - Number of partitions that will be provisioned during initial cluster provisioning. partitions are the logical shards used to process messages. + + Partitions: Number of partitions that will be provisioned during initial cluster provisioning. partitions are the logical shards used to process messages. Cannot be higher than `65535` (You should almost never need as many partitions anyway) @@ -1763,588 +2059,586 @@ NOTE 1: This config entry only impacts the initial number of partitions, the val NOTE 2: This will be renamed to `default-num-partitions` by default as of v1.3+ Default: 24 + - - Configures the global default replication factor to be used by the the system. + + Default replication factor: Configures the global default replication factor to be used by the the system. Note that this value only impacts the cluster initial provisioning and will not be respected after the cluster has been provisioned. To update existing clusters use the `restatectl` utility. - - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - Size of the default thread pool used to perform internal tasks. If not set, it defaults to the number of CPU cores. + + Shutdown grace timeout: This timeout is used when shutting down the various Restate components to drain all the internal queues. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Log filter configuration. Can be overridden by the `RUST_LOG` environment variable. Check the [`RUST_LOG` documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more details how to configure it. + + Default async runtime thread pool: Size of the default thread pool used to perform internal tasks. If not set, it defaults to the number of CPU cores. + - - Log format - - - - Enables verbose logging. Not recommended in production. - + + Logging Filter: Log filter configuration. Can be overridden by the `RUST_LOG` environment variable. Check the [`RUST_LOG` documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more details how to configure it. - - Enables compact logging. - + - - Enables json logging. You can use a json log collector to ingest these logs and further process them. - + + Logging format: Format to use when logging. - + + - `"pretty"` : Enables verbose logging. Not recommended in production. + - `"compact"` : Enables compact logging. + - `"json"` : Enables json logging. You can use a json log collector to ingest these logs and further process them. - - Disable ANSI terminal codes for logs. This is useful when the log collector doesn't support processing ANSI terminal codes. + + Disable ANSI in log output: Disable ANSI terminal codes for logs. This is useful when the log collector doesn't support processing ANSI terminal codes. + - + Address to bind for the tokio-console tracing subscriber. If unset and restate-server is built with tokio-console support, it'll listen on `0.0.0.0:6669`. + - + Disable prometheus metric recording and reporting. Default is `false`. + - + Storage high priority thread pool This configures the restate-managed storage thread pool for performing high-priority or latency-sensitive storage tasks when the IO operation cannot be performed on in-memory caches. + - + Storage low priority thread pool This configures the restate-managed storage thread pool for performing low-priority or latency-insensitive storage tasks. + - + Non-zero human-readable bytes + - - The memory size used across all memtables (ratio between 0 to 1.0). This limits how much memory memtables can eat up from the value in rocksdb-total-memory-limit. When set to 0, memtables can take all available memory up to the value specified in rocksdb-total-memory-limit. This value will be sanitized to 1.0 if outside the valid bounds. + + Rocksdb total memtable size ratio: The memory size used across all memtables (ratio between 0 to 1.0). This limits how much memory memtables can eat up from the value in rocksdb-total-memory-limit. When set to 0, memtables can take all available memory up to the value specified in rocksdb-total-memory-limit. This value will be sanitized to 1.0 if outside the valid bounds. + - - The number of threads to reserve to Rocksdb background tasks. Defaults to the number of cores on the machine. + + Rocksdb Background Threads: The number of threads to reserve to Rocksdb background tasks. Defaults to the number of cores on the machine. + - - The number of threads to reserve to high priority Rocksdb background tasks. + + Rocksdb High Priority Background Threads: The number of threads to reserve to high priority Rocksdb background tasks. + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Rocksdb stall detection threshold: This defines the duration after which a write is to be considered in \"stall\" state. For every write that meets this threshold, the system will increment the `restate.rocksdb_stall_flare` gauge, if the write is unstalled, the guage will be updated accordingly. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Note if automatic memory budgeting is enabled, it should be safe to allow rocksdb to stall if it hits the limit. However, if rocksdb stall kicked in, it's unlikely that the system will recover from this without intervention. + + Allow rocksdb writes to stall if memory limit is reached: Note if automatic memory budgeting is enabled, it should be safe to allow rocksdb to stall if it hits the limit. However, if rocksdb stall kicked in, it's unlikely that the system will recover from this without intervention. + - + + Rocksdb performance statistics level: Defines the level of PerfContext used internally by rocksdb. Default is `enable-count` which should be sufficient for most users. Note that higher levels incur a CPU cost and might slow down the critical path. + - - - Disable perf stats - + - `"disable"` : Disable perf stats + - `"enable-count"` : Enables only count stats + - `"enable-time-except-for-mutex"` : Count stats and enable time stats except for mutexes + - `"enable-time-and-c-p-u-time-except-for-mutex"` : Other than time, also measure CPU time counters. Still don't measure time (neither wall time nor CPU time) for mutexes + - `"enable-time"` : Enables count and time stats + - - Enables only count stats - + + Metadata update interval: The idle time after which the node will check for metadata updates from metadata store. This helps the node detect if it has been operating with stale metadata for extended period of time, primarily because it didn't interact with other peers in the cluster during that period. - - Count stats and enable time stats except for mutexes - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" - - Other than time, also measure CPU time counters. Still don't measure time (neither wall time nor CPU time) for mutexes - + - - Enables count and time stats - + + Timeout for metadata peer-to-peer fetching: When a node detects that a new metadata version exists, it'll attempt to fetch it from its peers. After this timeout duration has passed, the node will attempt to fetch the metadata from metadata store as well. This is to ensure that the nodes converge quickly while reducing the load on the metadata store. - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + + Network error retry policy: The retry policy for network related errors - - Definition of a retry policy - - - No retry strategy. + + + No retry strategy. + + - - - - +Set `type: "none"` + - - Retry with a fixed delay strategy. + + + + Retry with a fixed delay strategy. + + - - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Set `type: "fixed-delay"` - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + + Interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - - Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - - - + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - + - - The factor to use to compute the next retry attempt. - + + + + Retry with an exponential strategy. The next retry is computed as `min(last_retry_interval * factor, max_interval)`. - - Number of maximum attempts before giving up. Infinite retries if unset. - + + + +Set `type: "exponential"` - - Maximum interval between retries. + + + + Initial Interval: Initial interval for the first retry attempt. Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - + - + + Factor: The factor to use to compute the next retry attempt. + + + + + Max attempts: Number of maximum attempts before giving up. Infinite retries if unset. + + + + + Max interval: Maximum interval between retries. + +Can be configured using the [`jiff::fmt::friendly`](https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html) format or ISO8601, for example `5 hours`. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Initialization timeout: The timeout until the node gives up joining a cluster and initializing itself. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Restate uses Scarf to collect anonymous usage data to help us understand how the software is being used. You can set this flag to true to disable this collection. It can also be set with the environment variable DO_NOT_TRACK=1. + + Disable telemetry: Restate uses Scarf to collect anonymous usage data to help us understand how the software is being used. You can set this flag to true to disable this collection. It can also be set with the environment variable DO_NOT_TRACK=1. + - - This is a shortcut to set both [`Self::tracing_runtime_endpoint`], and [`Self::tracing_services_endpoint`]. + + Tracing Endpoint: This is a shortcut to set both [`Self::tracing_runtime_endpoint`], and [`Self::tracing_services_endpoint`]. Specify the tracing endpoint to send runtime traces to. Traces will be exported using [OTLP gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc) through [opentelemetry_otlp](https://docs.rs/opentelemetry-otlp/0.12.0/opentelemetry_otlp/). To configure the sampling, please refer to the [opentelemetry autoconfigure docs](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#sampler). + - - Overrides [`Self::tracing_endpoint`] for runtime traces + + Runtime Tracing Endpoint: Overrides [`Self::tracing_endpoint`] for runtime traces Specify the tracing endpoint to send runtime traces to. Traces will be exported using [OTLP gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc) through [opentelemetry_otlp](https://docs.rs/opentelemetry-otlp/0.12.0/opentelemetry_otlp/). To configure the sampling, please refer to the [opentelemetry autoconfigure docs](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#sampler). + - - Overrides [`Self::tracing_endpoint`] for services traces + + Services Tracing Endpoint: Overrides [`Self::tracing_endpoint`] for services traces Specify the tracing endpoint to send services traces to. Traces will be exported using [OTLP gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc) through [opentelemetry_otlp](https://docs.rs/opentelemetry-otlp/0.12.0/opentelemetry_otlp/). To configure the sampling, please refer to the [opentelemetry autoconfigure docs](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#sampler). + - - If set, an exporter will be configured to write traces to files using the Jaeger JSON format. Each trace file will start with the `trace` prefix. + + Distributed Tracing JSON Export Path: If set, an exporter will be configured to write traces to files using the Jaeger JSON format. Each trace file will start with the `trace` prefix. If unset, no traces will be written to file. It can be used to export traces in a structured format without configuring a Jaeger agent. To inspect the traces, open the Jaeger UI and use the Upload JSON feature to load and inspect them. + - - Distributed tracing exporter filter. Check the [`RUST_LOG` documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more details how to configure it. + + Tracing Filter: Distributed tracing exporter filter. Check the [`RUST_LOG` documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) for more details how to configure it. + - - Specify additional headers you want the system to send to the tracing endpoint (e.g. authentication headers). + + Additional tracing headers: Specify additional headers you want the system to send to the tracing endpoint (e.g. authentication headers). + - - A path to a file, such as \"/var/secrets/key.pem\", which contains exactly one ed25519 private key in PEM format. Such a file can be generated with `openssl genpkey -algorithm ed25519`. If provided, this key will be used to attach JWTs to requests from this client which SDKs may optionally verify, proving that the caller is a particular Restate instance. + + Request identity private key PEM file: A path to a file, such as \"/var/secrets/key.pem\", which contains exactly one ed25519 private key in PEM format. Such a file can be generated with `openssl genpkey -algorithm ed25519`. If provided, this key will be used to attach JWTs to requests from this client which SDKs may optionally verify, proving that the caller is a particular Restate instance. This file is currently only read on client creation, but this may change in future. Parsed public keys will be logged at INFO level in the same format that SDKs expect. + - - Headers that should be applied to all outgoing requests (HTTP and Lambda). Defaults to `x-restate-cluster-name: `. + + Additional request headers: Headers that should be applied to all outgoing requests (HTTP and Lambda). Defaults to `x-restate-cluster-name: <cluster name>`. + - - Configuration for the HTTP/2 keep-alive mechanism, using PING frames. + + HTTP/2 Keep-alive: Configuration for the HTTP/2 keep-alive mechanism, using PING frames. If unset, HTTP/2 keep-alive are disabled. -Please note: most gateways don't propagate the HTTP/2 keep-alive between downstream and upstream hosts. In those environments, you need to make sure the gateway can detect a broken connection to the upstream deployment(s). - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + HTTP/2 Keep-alive interval: Sets an interval for HTTP/2 PING frames should be sent to keep a connection alive. + +You should set this timeout with a value lower than the `abort_timeout`. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Timeout: Sets a timeout for receiving an acknowledgement of the keep-alive ping. + +If the ping is not acknowledged within the timeout, the connection will be closed. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - A URI, such as `http://127.0.0.1:10001`, of a server to which all invocations should be sent, with the `Host` header set to the deployment URI. HTTPS proxy URIs are supported, but only HTTP endpoint traffic will be proxied currently. Can be overridden by the `HTTP_PROXY` environment variable. + + Proxy URI: A URI, such as `http://127.0.0.1:10001`, of a server to which all invocations should be sent, with the `Host` header set to the deployment URI. HTTPS proxy URIs are supported, but only HTTP endpoint traffic will be proxied currently. Can be overridden by the `HTTP_PROXY` environment variable. + - - HTTP authorities eg `localhost`, `restate.dev`, `127.0.0.1` that should not be proxied by the http_proxy. Ports are ignored. Subdomains are also matched. An entry “*” matches all hostnames. Can be overridden by the `NO_PROXY` environment variable, which supports comma separated values. + + No proxy: HTTP authorities eg `localhost`, `restate.dev`, `127.0.0.1` that should not be proxied by the http_proxy. Ports are ignored. Subdomains are also matched. An entry “*” matches all hostnames. Can be overridden by the `NO_PROXY` environment variable, which supports comma separated values. + - + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Connect timeout: How long to wait for a TCP connection to be established before considering it a failed attempt. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Sets the initial maximum of locally initiated (send) streams. + + Initial Max Send Streams: Sets the initial maximum of locally initiated (send) streams. This value will be overwritten by the value included in the initial SETTINGS frame received from the peer as part of a [connection preface]. Default: None **NOTE**: Setting this value to None (default) users the default recommended value from HTTP2 specs + - - Name of the AWS profile to select. Defaults to 'AWS_PROFILE' env var, or otherwise the `default` profile. + + AWS Profile: Name of the AWS profile to select. Defaults to 'AWS_PROFILE' env var, or otherwise the `default` profile. + - - An external ID to apply to any AssumeRole operations taken by this client. https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html Can be overridden by the `AWS_EXTERNAL_ID` environment variable. + + AssumeRole external ID: An external ID to apply to any AssumeRole operations taken by this client. https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html Can be overridden by the `AWS_EXTERNAL_ID` environment variable. + - - Request minimum size to enable compression. The request size includes the total of the journal replay and its framing using Restate service protocol, without accounting for the json envelope and the base 64 encoding. + + Request Compression threshold: Request minimum size to enable compression. The request size includes the total of the journal replay and its framing using Restate service protocol, without accounting for the json envelope and the base 64 encoding. Default: 4MB (The default AWS Lambda Limit is 6MB, 4MB roughly accounts for +33% of Base64 and the json envelope). - - - - Human-readable bytes - - - - - + Human-readable bytes - - Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + + Disable Direct IO for reads: Files will be opened in \"direct I/O\" mode which means that data r/w from the disk will not be cached or buffered. The hardware buffer of the devices may however still be used. Memory mapped files are not impacted by these parameters. + - - Use O_DIRECT for writes in background flush and compactions. + + Disable Direct IO for flush and compactions: Use O_DIRECT for writes in background flush and compactions. + - - The default depends on the different rocksdb use-cases at Restate. + + Disable WAL: The default depends on the different rocksdb use-cases at Restate. Supports hot-reloading (Partial / Bifrost only) + - + Disable rocksdb statistics collection Default: False (statistics enabled) - - - Default: the number of CPU cores on this node. - - If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - - - Non-zero human-readable bytes - - - - + + RocksDB max background jobs (flushes and compactions): Default: the number of CPU cores on this node. - - - StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - -Default: \"except-detailed-timers\" - - - - - - - Disable all metrics - - - - Disable timer stats, and skip histogram stats - - - - Skip timer stats - - - - Collect all stats except time inside mutex lock AND time spent on compression. - - - - Collect all stats except the counters requiring to get time inside the mutex lock. - + + RocksDB compaction readahead size in bytes: If non-zero, we perform bigger reads when doing compaction. If you're running RocksDB on spinning disks, you should set this to at least 2MB. That way RocksDB's compaction is doing sequential instead of random reads. - - Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - + Non-zero human-readable bytes + - - + + RocksDB statistics level: StatsLevel can be used to reduce statistics overhead by skipping certain types of stats in the stats collection process. - - +Default: \"except-detailed-timers\" - + + - `"disable-all"` : Disable all metrics + - `"except-histogram-or-timers"` : Disable timer stats, and skip histogram stats + - `"except-timers"` : Skip timer stats + - `"except-detailed-timers"` : Collect all stats except time inside mutex lock AND time spent on compression. + - `"except-time-for-mutex"` : Collect all stats except the counters requiring to get time inside the mutex lock. + - `"all"` : Collect all stats, including measuring duration of mutex operations. If getting time is expensive on the platform to run, it can reduce scalability to more threads, especially for writes. - - Verbosity of the LOG. + + RocksDB log level: Verbosity of the LOG. Default: \"error\" - - - - Verbosity of the LOG. - - - - - + Verbosity of the LOG. - - Number of info LOG files to keep + + RocksDB log keep file num: Number of info LOG files to keep Default: 1 + - - Max size of info LOG file + + RocksDB log max file size: Max size of info LOG file Default: 64MB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - - Uncompressed block size + + RocksDB block size: Uncompressed block size Default: 64KiB - - - - Non-zero human-readable bytes - - - - - + Non-zero human-readable bytes - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Gossip tick interval: The interval at which the failure detector will tick. Decrease this value for faster reaction to node failures. Note, that every tick comes with an overhead. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Specifies how many gossip intervals of inactivity need to pass before considering a node as dead. + + Gossip failure threshold: Specifies how many gossip intervals of inactivity need to pass before considering a node as dead. + - - On every gossip interval, how many peers each node attempts to gossip with. The default is optimized for small clusters (less than 5 nodes). On larger clusters, if gossip overhead is noticeable, consider reducing this value to 1. + + Number of peers to gossip: On every gossip interval, how many peers each node attempts to gossip with. The default is optimized for small clusters (less than 5 nodes). On larger clusters, if gossip overhead is noticeable, consider reducing this value to 1. + - - Gossips before failure detector is stable + + Gossips before failure detector is stable: + - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - - How many intervals need to pass without receiving any gossip messages before considering this node as potentially isolated/dead. This threshold is used in the case where the node can still send gossip messages but did not receive any. This can rarely happen in asymmetric network partitions. + + Gossip loneliness threshold: How many intervals need to pass without receiving any gossip messages before considering this node as potentially isolated/dead. This threshold is used in the case where the node can still send gossip messages but did not receive any. This can rarely happen in asymmetric network partitions. In this case, the node will advertise itself as dead in the gossip messages it sends out. Note: this threshold does not apply to a cluster that's configured with a single node. + - - In addition to basic health/liveness information, the gossip protocol is used to exchange extra information about the roles hosted by this node. For instance, which partitions are currently running, their configuration versions, and the durable LSN of the corresponding partition databases. This information is sent every Nth gossip message. This setting controls the frequency of this exchange. For instance, `10` means that every 10th gossip message will contain the extra information about. + + Gossip extras exchange frequency: In addition to basic health/liveness information, the gossip protocol is used to exchange extra information about the roles hosted by this node. For instance, which partitions are currently running, their configuration versions, and the durable LSN of the corresponding partition databases. This information is sent every Nth gossip message. This setting controls the frequency of this exchange. For instance, `10` means that every 10th gossip message will contain the extra information about. + - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Gossips time skew threshold: The time skew is the maximum acceptable time difference between the local node and the time reported by peers via gossip messages. The time skew is also used to ignore gossip messages that are too old. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" + - + Maximum journal retention duration that can be configured. When discovering a service deployment, or when modifying the journal retention using the Admin API, the given value will be clamped. Unset means no limit. - - - - Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - + Human-readable duration: Duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" or "0" - - The default retry policy to use for invocations. + + Default retry policy: The default retry policy to use for invocations. The retry policy can be customized on a service/handler basis, using the respective SDK APIs. - - - - - - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. - - - The factor to use to compute the next retry attempt. Default: `2.0`. - - - - - - - Unlimited retries. - + + + + Initial Interval: Initial interval for the first retry attempt. - - Bounded number of retries. - - - - +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" - - + - - + + Factor: The factor to use to compute the next retry attempt. Default: `2.0`. - - - - - Pause the invocation when max attempts are reached. - + - - Kill the invocation when max attempts are reached. - + + Max attempts: Number of maximum attempts (including the initial) before giving up. No retries if set to 1. - - + + - `"unlimited"` : Unlimited retries. + + + Bounded number of retries. - - Non-zero duration string in either jiff human friendly or ISO8601 format. Check https://docs.rs/jiff/latest/jiff/struct.Span.html#parsing-and-printing for more details. + - + + On max attempts: Behavior when max attempts are reached. + + + - `"pause"` : Pause the invocation when max attempts are reached. + - `"kill"` : Kill the invocation when max attempts are reached. + + + + Max interval: Maximum interval between retries. + +Examples: +"10 hours" or "5 days" or "5d" or "1h 4m" or "P40D" + - - Maximum max attempts configurable in an invocation retry policy. When discovering a service deployment with configured retry policies, or when modifying the invocation retry policy using the Admin API, the given value will be clamped. + + Max configurable value for retry policy max attempts: Maximum max attempts configurable in an invocation retry policy. When discovering a service deployment with configured retry policies, or when modifying the invocation retry policy using the Admin API, the given value will be clamped. `None` means no limit, that is infinite retries is enabled. + diff --git a/docs/schemas/restate-server-configuration-schema.json b/docs/schemas/restate-server-configuration-schema.json index 1f04ebd..5f34038 100644 --- a/docs/schemas/restate-server-configuration-schema.json +++ b/docs/schemas/restate-server-configuration-schema.json @@ -205,7 +205,7 @@ }, "location": { "title": "Node Location", - "description": "[PREVIEW FEATURE] Setting the location allows Restate to form a tree-like cluster topology. The value is written in the format of \"region[.zone]\" to assign this node to a specific region, or to a zone within a region.\n\nThe value of region and zone is arbitrary but whitespace and `.` are disallowed.\n\nNOTE: It's _strongly_ recommended to not change the node's location string after its initial registration. Changing the location may result in data loss or data inconsistency if `log-server` is enabled on this node.\n\nWhen this value is not set, the node is considered to be in the _default_ location. The _default_ location means that the node is not assigned to any specific region or zone.\n\n## Examples - `us-west` -- the node is in the `us-west` region. - `us-west.a1` -- the node is in the `us-west` region and in the `a1` zone. - `` -- [default] the node is in the default location", + "description": "[PREVIEW FEATURE] Setting the location allows Restate to form a tree-like cluster topology. The value is written in the format of \"region[.zone]\" to assign this node to a specific region, or to a zone within a region.\n\nThe value of region and zone is arbitrary but whitespace and `.` are disallowed.\n\nNOTE: It's _strongly_ recommended to not change the node's location string after its initial registration. Changing the location may result in data loss or data inconsistency if `log-server` is enabled on this node.\n\nWhen this value is not set, the node is considered to be in the _default_ location. The _default_ location means that the node is not assigned to any specific region or zone.\n\nExamples - `us-west` -- the node is in the `us-west` region. - `us-west.a1` -- the node is in the `us-west` region and in the `a1` zone. - `` -- [default] the node is in the default location", "type": "string" }, "force-node-id": { diff --git a/package-lock.json b/package-lock.json index 70e6852..732226e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,31 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@apidevtools/json-schema-ref-parser": "^14.2.1", "@restatedev/restate": "^1.4.4", "chokidar": "^4.0.3", "concurrently": "^9.2.0", "yoga-wasm-web": "^0.3.3" } }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-14.2.1.tgz", + "integrity": "sha512-HmdFw9CDYqM6B25pqGBpNeLCKvGPlIx1EbLrVL0zPvj50CJQUHyBNBw45Muk0kEIkogo1VZvOKHajdMuAzSxRg==", + "license": "MIT", + "dependencies": { + "js-yaml": "^4.1.0" + }, + "engines": { + "node": ">= 20" + }, + "funding": { + "url": "https://github.com/sponsors/philsturgeon" + }, + "peerDependencies": { + "@types/json-schema": "^7.0.15" + } + }, "node_modules/@restatedev/restate": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/@restatedev/restate/-/restate-1.4.4.tgz", @@ -86,6 +105,13 @@ "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", "hasInstallScript": true }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT", + "peer": true + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -110,6 +136,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -252,6 +284,18 @@ "node": ">=8" } }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", diff --git a/package.json b/package.json index d23e4e1..1dec138 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "", "license": "ISC", "dependencies": { + "@apidevtools/json-schema-ref-parser": "^14.2.1", "@restatedev/restate": "^1.4.4", "chokidar": "^4.0.3", "concurrently": "^9.2.0", diff --git a/scripts/generate-restate-config-viewer.js b/scripts/generate-restate-config-viewer.js index 1f50a8d..ed731d0 100755 --- a/scripts/generate-restate-config-viewer.js +++ b/scripts/generate-restate-config-viewer.js @@ -2,34 +2,59 @@ const fs = require('fs'); const path = require('path'); +const $RefParser = require("@apidevtools/json-schema-ref-parser"); const schemaPath = "docs/schemas/restate-server-configuration-schema.json"; const outputPath = "docs/references/server-config.mdx"; -function parseJsonSchema(schemaPath) { - const schemaContent = fs.readFileSync(schemaPath, 'utf8'); - const schema = JSON.parse(schemaContent); - return schema; +async function parseJsonSchema(schemaPath) { + try { + return await $RefParser.dereference(schemaPath, { + mutateInputSchema: false, + continueOnError: false, + dereference: { + circular: "ignore" + } + }); + } catch (error) { + console.error('Error parsing JSON schema:', error); + throw error; + } } -function formatDescription(description) { - if (!description) return ''; - // Convert markdown links to proper format and escape quotes - return description +function formatDescription(description, title, examples) { + // Escape HTML-like syntax in code blocks and regular text + const cleanDescription = description ? description .replace(/\n\n/g, '\n\n') - .replace(/`([^`]+)`/g, '`$1`') + // Preserve code blocks with backticks but escape any HTML-like content within + .replace(/`([^`]+)`/g, (match, code) => { + return '`' + code.replace(//g, '>') + '`'; + }) + // Escape standalone HTML-like tags that aren't in code blocks + .replace(/<(?!\/?\w+[^>]*>)/g, '<') + .replace(/(?]*)>/g, '>') + // Convert markdown links to proper format .replace(/\[(.*?)\]\((.*?)\)/g, '[$1]($2)') - .replace(/"/g, '\\"'); + // Escape quotes for JSX attributes + .replace(/"/g, '\\"') : '' + + const exampleStr = examples && Array.isArray(examples) && examples.length > 0 + ? '\n\nExamples:\n' + examples.map(ex => `${JSON.stringify(ex, null, 2)}`).join(' or ') + : ''; + if (title && description && description.includes(title)) { + return `${cleanDescription}${exampleStr}`; + } + const titleStr = title ? `${title}: ` : ''; + return `${titleStr}${cleanDescription}${exampleStr}`; } function getTypeFromSchema(propSchema) { if (propSchema.type) { if (Array.isArray(propSchema.type)) { // Handle union types like ["string", "null"] - const nonNullTypes = propSchema.type.filter(t => t !== 'null'); const isOptional = propSchema.type.includes('null'); return { - type: nonNullTypes.length === 1 ? nonNullTypes[0] : nonNullTypes.join(' | '), + type: propSchema.type.join(' | '), optional: isOptional }; } @@ -52,154 +77,233 @@ function getTypeFromSchema(propSchema) { return { type: 'unknown', optional: false }; } +function getDefaultValueString(propSchema, type) { + let value = propSchema.default; + if (value === undefined) return null; + else if (value === null) return `default=null`; + else if (typeof value === 'string') return `default="${value}"`; + // needs to be checked before 'object' because typeof array is 'object' + else if (type === 'array') return `default=${JSON.stringify(value)}` + else if (typeof value === 'object') return null + else return `default=${String(value)}`; +} + +function generatePostAttr(propSchema, type) { + let postTags = [] + const defaultValue = getDefaultValueString(propSchema, type) + if (defaultValue) { + postTags.push(`\'${defaultValue}\'`); + } + if (propSchema.format) { + postTags.push(`\'format: ${propSchema.format}\'`); + } + if (propSchema.enum) { + postTags.push(`\'enum: ${propSchema.enum.map(v => (typeof v === 'string' ? `"${v}"` : v)).join(', ')}\'`); + } + if (propSchema.minimum) { + postTags.push(`\'minimum: ${propSchema.minimum}\'`); + } + if (propSchema.maximum) { + postTags.push(`\'maximum: ${propSchema.maximum}\'`); + } + if (propSchema.minLength) { + postTags.push(`\'minLength: ${propSchema.minLength}\'`); + } + if (propSchema.maxLength) { + postTags.push(`\'maxLength: ${propSchema.maxLength}\'`); + } + + return ` post={[${postTags.join(",")}]}`; +} + +function parseVariantName(variant, index) { + if (variant.enum && variant.enum.length === 1) { + let variantValue = variant.enum[0]; + if (typeof variantValue === 'string') { + return `"${variantValue}"`; + } else if (typeof variantValue === 'object') { + return JSON.stringify(variantValue); + } else { + return `${String(variantValue)}`; + } + } else if (variant.title) { + return `Option ${index + 1}: ${variant.title}`; + } else if (variant.const !== undefined) { + return `"${variant.const}"`; + } else if (variant.description) { + return `Option ${index + 1}: ${variant.description}`; + } else { + return `Option ${index + 1}`; + } +} + +function generateResponseFieldsFromProperties(properties, requiredProps = [], level = 0) { + let generatedOutput = ''; + Object.entries(properties).forEach(([subPropName, subPropSchema]) => { + generatedOutput += generateResponseField( + subPropName, + subPropSchema, + requiredProps.includes(subPropName), + level + 2 + ); + }); + return generatedOutput +} + function generateResponseField(propName, propSchema, isRequired = false, level = 0) { const indent = ' '.repeat(level); const { type, optional } = getTypeFromSchema(propSchema); const required = isRequired && !optional ? ' required' : ''; - const description = formatDescription(propSchema.description || propSchema.title || ''); - - // Format default value properly for the attribute - let defaultAttr = ''; - if (propSchema.default !== undefined && propSchema.default !== null) { - let defaultStr = ''; - if (typeof propSchema.default === 'string') { - defaultStr = `"${propSchema.default}"`; - } else if (typeof propSchema.default === 'object') { - defaultStr = JSON.stringify(propSchema.default); - } else { - defaultStr = `${String(propSchema.default)}`; - } - // Escape quotes for the attribute - // const escapedDefault = defaultStr.replace(/"/g, '"'); - defaultAttr = ` default={${defaultStr}}`; + let description = formatDescription(propSchema.description, propSchema.title, propSchema.examples); + + let postAttr = generatePostAttr(propSchema, type); + + // Special case: if type is string and enum has a single value, suggest setting that value (for example for type: "exponential-delay") + if (propSchema.default === undefined && type === 'string' && Array.isArray(propSchema.enum) && propSchema.enum.length === 1) { + let value = propSchema.enum[0]; + description += `\n\nSet \`${propName}: "${value}"\``; } - - let output = `${indent}\n`; - + + let output = `${indent}\n`; if (description) { - output += `${indent} ${description}\n`; + output += `${indent} ${description}\n\n`; } // Handle object properties - if (propSchema.type === 'object' && propSchema.properties) { - const requiredProps = propSchema.required || []; + if (type === 'object' && propSchema.properties) { output += `${indent} \n`; - output += `${indent} \n`; - - Object.entries(propSchema.properties).forEach(([subPropName, subPropSchema]) => { - output += generateResponseField( - subPropName, - subPropSchema, - requiredProps.includes(subPropName), - level + 2 - ); - }); - - output += `${indent} \n`; + + if (propSchema.oneOf) { + const variants = propSchema.oneOf; + output += `${indent} \n`; + + variants.forEach((variant, index) => { + const variantName = parseVariantName(variant, index); + output += `${indent}\n`; + output += generateResponseFieldsFromProperties(variant.properties, propSchema.required, level); + output += generateResponseFieldsFromProperties(propSchema.properties, propSchema.required, level); + output += `${indent} \n`; + }); + + } else { + output += `${indent} \n`; + output += generateResponseFieldsFromProperties( propSchema.properties, propSchema.required, level); + output += `${indent} \n`; + } } // Handle array items - if (propSchema.type === 'array' && propSchema.items) { + if (type === 'array' && propSchema.items) { output += `${indent} \n`; output += `${indent} \n`; - output += generateResponseField('item', propSchema.items, false, level + 2); + output += generateResponseField('item', propSchema.items, propSchema.required, level + 2); output += `${indent} \n`; } - // Handle oneOf/anyOf - if (propSchema.oneOf || propSchema.anyOf) { - const variants = propSchema.oneOf || propSchema.anyOf; - output += `${indent} \n`; - output += `${indent} \n`; - - variants.forEach((variant, index) => { - const variantName = variant.title || `option-${index + 1}`; - output += generateResponseField(variantName, variant, false, level + 2); - }); + // Handle anyOf + if (type === 'anyOf') { + const variants = propSchema.anyOf; - output += `${indent} \n`; - } - - output += `${indent}\n\n`; - return output; -} + // Handle the optional type case of [T, null] + if (variants.length === 2 && variants.some(variant => variant.type === "null")) { + let optionalVariant = variants.find(variant => variant.type !== "null") + + const optionalType = getTypeFromSchema(optionalVariant); + output = `${indent}\n`; + if (description) { + output += `${indent} ${description}\n\n`; + } + if (optionalVariant.description) { + output += `${indent} ${formatDescription(optionalVariant.description, optionalVariant.title, optionalVariant.examples)}\n` + } + if (optionalType.type === 'object' && optionalVariant.properties) { + output += `${indent} \n`; + output += `${indent} \n`; + output += generateResponseFieldsFromProperties(optionalVariant.properties, optionalVariant.required, level); + output += `${indent} \n`; + + } else if (optionalType.type === 'oneOf') { + const oneOfVariants = optionalVariant.oneOf; + output += `${indent} \n`; -function expandDefinitions(schema, definitions) { - // Helper function to resolve $ref definitions - function resolveRef(propSchema) { - if (propSchema.$ref && propSchema.$ref.startsWith('#/definitions/')) { - const defName = propSchema.$ref.split('/').pop(); - if (definitions[defName]) { - return { ...definitions[defName], _refName: defName }; + oneOfVariants.forEach((variant, index) => { + let variantName = parseVariantName(variant, index) + if ((['object', 'oneOf', 'array'].some(t => variant.type.includes(t))) && variant.properties) { + output += generateResponseFieldsFromProperties(variant.properties, variant.required, level); + } else { + output += `${indent} - \`${variantName}\` : ${formatDescription(variant.description)}\n` + } + }); } + } else { + output += `${indent} \n`; + + variants.forEach((variant, index) => { + let variantName = parseVariantName(variant, index); + if ((['object', 'oneOf', 'array'].some(t => variant.type.includes(t))) && variant.properties) { + output += `${indent} \n`; + output += `${indent} \n`; + output += generateResponseFieldsFromProperties(variant.properties, variant.required, level); + output += `${indent} \n`; + } else { + output += `${indent} - \`${variantName}\` : ${formatDescription(variant.description)}\n` + } + }); + } - return propSchema; } - - // Recursively expand references in the schema - function expandRefs(obj) { - if (typeof obj !== 'object' || obj === null) return obj; - - if (obj.$ref) { - return expandRefs(resolveRef(obj)); + + // Handle oneOf + if (type === 'oneOf') { + const variants = propSchema.oneOf + + output = `${indent}\n`; + if (description) { + output += `${indent} ${description}\n\n`; } - - const result = {}; - for (const [key, value] of Object.entries(obj)) { - if (key === 'properties' && typeof value === 'object') { - result[key] = {}; - for (const [propName, propSchema] of Object.entries(value)) { - result[key][propName] = expandRefs(propSchema); - } - } else if (Array.isArray(value)) { - result[key] = value.map(item => expandRefs(item)); - } else if (typeof value === 'object') { - result[key] = expandRefs(value); + output += `${indent} \n`; + + variants.forEach((variant, index) => { + let variantName = parseVariantName(variant, index); + if ((['object', 'oneOf', 'array'].some(t => variant.type.includes(t))) && variant.properties) { + output += `${indent} \n`; + output += `${indent} \n`; + output += `${indent} ${formatDescription(variant.description, undefined, variant.examples)}\n\n`; + output += generateResponseFieldsFromProperties( variant.properties, variant.required, level); + output += `${indent} \n`; } else { - result[key] = value; + output += `${indent} - \`${variantName}\` : ${formatDescription(variant.description)}\n` } - } - return result; + }); } - return expandRefs(schema); + output += `${indent}\n\n`; + return output; } + function generateRestateConfigViewer(schema) { let output = `---\ntitle: "Restate Server Configuration"\ndescription: "Reference of the configuration options for Restate Server."\nmode: "wide"\n---\n\n` + 'import Intro from "/snippets/common/default-configuration.mdx" \n' + '\n' + '' + '\n\n'; - - // Expand definitions into the main schema - const definitions = schema.definitions || {}; - const expandedSchema = expandDefinitions(schema, definitions); - - if (expandedSchema.properties) { - const requiredProps = expandedSchema.required || []; - - Object.entries(expandedSchema.properties).forEach(([propName, propSchema]) => { - output += generateResponseField( - propName, - propSchema, - requiredProps.includes(propName), - 0 - ); - }); + + if (schema.properties) { + output += generateResponseFieldsFromProperties(schema.properties, schema.required, -2); } - return output; } -function main() { + +async function generate() { if (!fs.existsSync(schemaPath)) { console.error(`Schema file not found: ${schemaPath}`); process.exit(1); } try { - const schema = parseJsonSchema(schemaPath); + const schema = await parseJsonSchema(schemaPath); const mdxContent = generateRestateConfigViewer(schema); if (outputPath) { @@ -215,7 +319,7 @@ function main() { } if (require.main === module) { - main(); + generate(); } -module.exports = { generateSchemaViewer: generateRestateConfigViewer }; \ No newline at end of file +module.exports = { generateSchemaViewer: generate }; \ No newline at end of file