sleet 0.1.0

A fleet manager for SlateDB databases
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "sleet fleet config",
  "description": "The fleet config: `sleet.toml` at the fleet root.",
  "type": "object",
  "properties": {
    "database": {
      "description": "Service settings applied to every database; a `dbs/<db>.toml`\nfile overrides them per field.",
      "$ref": "#/$defs/DatabaseConfig",
      "default": {}
    },
    "node": {
      "description": "Settings every node follows.",
      "$ref": "#/$defs/NodeConfig",
      "default": {
        "config_poll": "1m",
        "heartbeat_interval": "10s",
        "heartbeat_timeout": "30s"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "CompressionCodec": {
      "description": "SST compression codec.",
      "oneOf": [
        {
          "description": "Snappy.",
          "type": "string",
          "const": "snappy"
        },
        {
          "description": "Zlib (deflate).",
          "type": "string",
          "const": "zlib"
        },
        {
          "description": "LZ4.",
          "type": "string",
          "const": "lz4"
        },
        {
          "description": "Zstandard.",
          "type": "string",
          "const": "zstd"
        }
      ]
    },
    "CoordinatorOverrides": {
      "description": "Compaction coordinator settings (SlateDB `CompactorOptions`; sleet\nalways runs the coordinator without an embedded worker).",
      "type": "object",
      "properties": {
        "commit_compacted_interval": {
          "description": "How often `Compacted` results are committed to the manifest.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "manifest_update_timeout": {
          "description": "How long manifest updates are retried before giving up.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_concurrent_compactions": {
          "description": "Maximum compactions scheduled concurrently.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "poll_interval": {
          "description": "How often the coordinator polls the manifest to schedule compactions.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheduler": {
          "description": "Size-tiered compaction scheduler settings.",
          "anyOf": [
            {
              "$ref": "#/$defs/SchedulerOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "worker_heartbeat_timeout": {
          "description": "Reclaim a `Running` job whose worker heartbeat is older than this.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CopierKind": {
      "description": "Who moves a mirror target's data objects.",
      "oneOf": [
        {
          "description": "sleet streams objects between the two stores itself.",
          "type": "string",
          "const": "builtin"
        },
        {
          "description": "sleet computes the object list per pass and drives\n`rclone copy --files-from`.",
          "type": "string",
          "const": "rclone"
        },
        {
          "description": "Bucket replication configured outside sleet ships the data\ndirectories; sleet backfills misses and commits manifests.",
          "type": "string",
          "const": "external"
        }
      ]
    },
    "DatabaseConfig": {
      "title": "sleet database config",
      "description": "Per-database service settings: the `[database]` table of `sleet.toml`\nand, verbatim, the contents of a `dbs/<db>.toml` registry file. All\nfields are optional; unset fields fall through to the next precedence\nlayer.",
      "type": "object",
      "properties": {
        "compaction-workers": {
          "description": "Compaction worker settings.",
          "anyOf": [
            {
              "$ref": "#/$defs/WorkersOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "compactor-coordinator": {
          "description": "Compaction coordinator settings.",
          "anyOf": [
            {
              "$ref": "#/$defs/CoordinatorOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "gc": {
          "description": "Garbage collection settings.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "mirror": {
          "description": "Mirror settings: named destination targets.",
          "anyOf": [
            {
              "$ref": "#/$defs/MirrorOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "services": {
          "description": "Which services run for the database. Default: all of them. An\nexplicit empty list registers the database but runs nothing.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Service"
          }
        }
      },
      "additionalProperties": false
    },
    "GcDetachOverrides": {
      "description": "Settings for the clone-detach GC pass (no file-age threshold).",
      "type": "object",
      "properties": {
        "enabled": {
          "description": "Set false to disable the detach pass.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "interval": {
          "description": "How often the detach pass runs.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "GcDirectoryOverrides": {
      "description": "GC settings for one resource directory.",
      "type": "object",
      "properties": {
        "dry_run": {
          "description": "Log deletions without performing them.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "enabled": {
          "description": "Set false to disable GC for this directory.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "interval": {
          "description": "How often the GC pass runs.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "min_age": {
          "description": "Minimum object age before deletion.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "GcOverrides": {
      "description": "Garbage collection settings, per SlateDB resource directory.",
      "type": "object",
      "properties": {
        "compacted": {
          "description": "The compacted SST directory.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDirectoryOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "compactions": {
          "description": "The compactions directory (`.compactions` job state).",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDirectoryOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "detach": {
          "description": "Detaching clones whose parent references are no longer needed.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDetachOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "manifest": {
          "description": "The manifest directory.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDirectoryOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "wal": {
          "description": "The WAL directory.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDirectoryOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "wal_fence": {
          "description": "Zero-byte WAL fence objects. Deleting fences too young can lose\nwrites; dry-run by default.",
          "anyOf": [
            {
              "$ref": "#/$defs/GcDirectoryOverrides"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "HumanDuration": {
      "description": "A duration in humantime form, e.g. \"10s\", \"5m\", \"1h 30m\".",
      "type": "string",
      "pattern": "^([0-9]+ *[a-zµ]+ *)+$"
    },
    "MirrorMode": {
      "description": "How a mirror target is kept in sync.",
      "oneOf": [
        {
          "description": "The sync pass plus the WAL tail, on a `poll` cadence with idle\nbackoff.",
          "type": "string",
          "const": "continuous"
        },
        {
          "description": "One pass every `interval`; each committed manifest is a\npoint-in-time cut.",
          "type": "string",
          "const": "periodic"
        }
      ]
    },
    "MirrorOverrides": {
      "description": "Mirror settings: the `[database.mirror]` table (fleet-wide) or the\n`[mirror]` table of a `dbs/<db>.toml`.",
      "type": "object",
      "properties": {
        "targets": {
          "description": "Named mirror targets. Layers merge per target name, then per\nfield: a `dbs/<db>.toml` entry overrides the fleet-wide target\nof the same name field by field, except that `url` and\n`source_prefix` travel together (a layer that sets either\noverrides both).",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/MirrorTargetOverrides"
          }
        }
      },
      "additionalProperties": false
    },
    "MirrorTargetOverrides": {
      "description": "One named mirror target. All fields are optional; unset fields fall\nthrough to the previous layer, then to built-in defaults.",
      "type": "object",
      "properties": {
        "checkpoint_lifetime": {
          "description": "Lifetime of the source pin checkpoint a pass holds while\ncopying; refreshed at half-life while the pass runs.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "copier": {
          "description": "Who moves data objects; sleet always commits manifests.",
          "anyOf": [
            {
              "$ref": "#/$defs/CopierKind"
            },
            {
              "type": "null"
            }
          ]
        },
        "copy_parallelism": {
          "description": "Builtin copier: concurrent object copies per pass.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "disabled": {
          "description": "Opt out of an inherited target. An ordinary overridable field,\nbecause per-field fall-through cannot unset a target.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "interval": {
          "description": "Periodic mode: the cadence between passes.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "min_age": {
          "description": "Prune deletion age floor for data objects at the target.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "mode": {
          "description": "How the target is kept in sync.",
          "anyOf": [
            {
              "$ref": "#/$defs/MirrorMode"
            },
            {
              "type": "null"
            }
          ]
        },
        "poll": {
          "description": "Continuous mode: the pass and WAL tail cadence.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "retention": {
          "description": "Restore-point retention; unset keeps everything.",
          "anyOf": [
            {
              "$ref": "#/$defs/RetentionOverrides"
            },
            {
              "type": "null"
            }
          ]
        },
        "source_prefix": {
          "description": "Scope the target to databases under this URL prefix (matched at\npath-segment boundaries) and map each one to `url` plus its\npath with the prefix stripped. For precedence this field and\n`url` travel together: a layer that sets either overrides both.",
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "description": "The destination root. On its own an exact destination for one\ndatabase; with `source_prefix`, the base the stripped database\npath is appended to.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "NodeConfig": {
      "description": "Settings every node follows. These are fleet-wide agreements: nodes\nmust judge liveness with the same timeout for placement to converge.",
      "type": "object",
      "properties": {
        "config_poll": {
          "description": "How often nodes re-read `sleet.toml` and LIST `dbs/`.",
          "$ref": "#/$defs/HumanDuration",
          "default": "1m"
        },
        "heartbeat_interval": {
          "description": "How often each node writes its heartbeat object.",
          "$ref": "#/$defs/HumanDuration",
          "default": "10s"
        },
        "heartbeat_timeout": {
          "description": "Nodes whose heartbeat is older than this are treated as dead.",
          "$ref": "#/$defs/HumanDuration",
          "default": "30s"
        }
      },
      "additionalProperties": false
    },
    "RetentionOverrides": {
      "description": "Restore-point retention for one mirror target.",
      "type": "object",
      "properties": {
        "keep": {
          "description": "Keep every restore point younger than this, plus the manifests\ntheir live checkpoints pin.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SchedulerOverrides": {
      "description": "Size-tiered compaction scheduler settings (SlateDB\n`SizeTieredCompactionSchedulerOptions`).",
      "type": "object",
      "properties": {
        "include_size_threshold": {
          "description": "A sorted run joins a compaction if its size is below this multiple\nof the smallest run already included.",
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "max_compaction_sources": {
          "description": "Maximum sources included together in one compaction.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "min_compaction_sources": {
          "description": "Minimum sources included together in one compaction.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "Service": {
      "description": "A per-database service.",
      "oneOf": [
        {
          "description": "Garbage collection.",
          "type": "string",
          "const": "gc"
        },
        {
          "description": "Standalone compaction coordinator (RFC-0025).",
          "type": "string",
          "const": "compactor-coordinator"
        },
        {
          "description": "Compaction workers (RFC-0025).",
          "type": "string",
          "const": "compaction-workers"
        },
        {
          "description": "Mirroring to per-database targets (RFC 0002).",
          "type": "string",
          "const": "mirror"
        }
      ]
    },
    "WorkersOverrides": {
      "description": "Compaction worker settings (SlateDB `CompactionWorkerOptions` plus\n`count`).",
      "type": "object",
      "properties": {
        "bytes_to_fetch": {
          "description": "Read-ahead request size in bytes while iterating input SSTs.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "compactions_poll_interval": {
          "description": "How often SlateDB workers poll `.compactions` for `Scheduled` jobs.\nSleet passes this value through to SlateDB's worker options.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "compression_codec": {
          "description": "Compression for SSTs the worker writes. Must match the writer's\n`compression_codec`.",
          "anyOf": [
            {
              "$ref": "#/$defs/CompressionCodec"
            },
            {
              "type": "null"
            }
          ]
        },
        "count": {
          "description": "Worker nodes for this database: the top `count` nodes of the\ndatabase's rendezvous ranking poll its compaction queue.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "heartbeat_bytes": {
          "description": "Bytes a worker must process before emitting a heartbeat.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "heartbeat_min_interval": {
          "description": "Minimum wall-clock time between heartbeat writes.",
          "anyOf": [
            {
              "$ref": "#/$defs/HumanDuration"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_concurrent_compactions": {
          "description": "Jobs a single worker may hold simultaneously.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "max_fetch_tasks": {
          "description": "Concurrent block-fetch tasks per input SST.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "max_sst_size": {
          "description": "Maximum output SST size in bytes before a new one is rolled.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0
        },
        "max_subcompactions": {
          "description": "Maximum subcompactions per job (RFC-0028); values <= 1 disable\nsubcompactions.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        },
        "min_filter_keys": {
          "description": "Write bloom filters for SSTs with at least this many keys. Must\nmatch the writer's `min_filter_keys`.",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint32",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  }
}