mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
blockvolume, durable: chunk cut timer off by default; dirty threshold 512 bounds a cut
The remote holds snapshots, not live data: cuts are published at snapshots, at detach/stop and on explicit request. The periodic timer is now off by default (operators may set one, e.g. 15m, as a host-loss safety net) and the dirty threshold is 512 chunks (2 GiB at 4 MiB), kept only as a bound on one cut's size. Success resets, failure backoff, no cut with nothing dirty and no cut while reconciling are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2df820002
commit
285d82d699
4 files changed
+14
-8
No files matched your search
@@ -19,9 +19,13 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultChunkPath = "/swblock/chunks"
|
||||
defaultChunkCaptureInterval = 30 * time.Second
|
||||
defaultChunkDirtyThreshold = 64 // chunks, 256 MiB at 4 MiB chunks
|
||||
defaultChunkPath = "/swblock/chunks"
|
||||
// The remote holds snapshots, not live data: cuts are published at
|
||||
// snapshots, at detach/stop and on explicit request. The timer is off
|
||||
// by default (an operator may set one, e.g. 15m, as a host-loss safety
|
||||
// net); the dirty threshold only bounds how large one cut can grow.
|
||||
defaultChunkCaptureInterval = 0
|
||||
defaultChunkDirtyThreshold = 512 // chunks, 2 GiB at 4 MiB chunks
|
||||
)
|
||||
|
||||
type chunkFlags struct {
|
||||
|
||||
@@ -31,8 +31,8 @@ func TestWALStoreChunkFlags(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if d.chunk.captureInterval != 30*time.Second || d.chunk.dirtyThreshold != 64 {
|
||||
t.Fatalf("scheduler defaults interval %s threshold %d, want 30s and 64", d.chunk.captureInterval, d.chunk.dirtyThreshold)
|
||||
if d.chunk.captureInterval != 0 || d.chunk.dirtyThreshold != 512 {
|
||||
t.Fatalf("scheduler defaults interval %s threshold %d, want timer off and 512", d.chunk.captureInterval, d.chunk.dirtyThreshold)
|
||||
}
|
||||
off, err := parseFlags(base("--durable-root=/tmp/sw-block", "--durable-impl=walstore-chunk", "--chunk-filer=x:1",
|
||||
"--chunk-capture-interval=0", "--chunk-dirty-threshold=0"))
|
||||
|
||||
@@ -174,8 +174,8 @@ func parseFlags(args []string) (flags, error) {
|
||||
fs.StringVar(&f.chunk.path, "chunk-path", defaultChunkPath, "walstore-chunk: filer directory holding one directory per volume (HEAD and chunk key bindings)")
|
||||
fs.StringVar(&f.chunk.collection, "chunk-collection", "", "walstore-chunk: collection for chunk needles (empty = filer default / storage rule)")
|
||||
fs.StringVar(&f.chunk.replication, "chunk-replication", "", "walstore-chunk: replication for chunk needles (empty = filer default / storage rule)")
|
||||
fs.DurationVar(&f.chunk.captureInterval, "chunk-capture-interval", defaultChunkCaptureInterval, "walstore-chunk: automatic cut once this long has passed since the last successful cut; 0 disables the timer")
|
||||
fs.IntVar(&f.chunk.dirtyThreshold, "chunk-dirty-threshold", defaultChunkDirtyThreshold, "walstore-chunk: automatic cut once this many chunks are dirty since the last HEAD; 0 disables the threshold")
|
||||
fs.DurationVar(&f.chunk.captureInterval, "chunk-capture-interval", defaultChunkCaptureInterval, "walstore-chunk: automatic cut once this long has passed since the last successful cut; 0 (default) disables the timer, e.g. 15m as a host-loss safety net")
|
||||
fs.IntVar(&f.chunk.dirtyThreshold, "chunk-dirty-threshold", defaultChunkDirtyThreshold, "walstore-chunk: bound on one cut's size: automatic cut once this many chunks are dirty since the last HEAD; 0 disables the bound")
|
||||
fs.BoolVar(&f.chunk.controlEndpoint, "chunk-control-endpoint", false, "walstore-chunk: expose the /chunk/* control routes (cut, snapshot, snapshots, snapshot/delete, detach) on the status HTTP listener; off by default; loopback-only like the listener")
|
||||
fs.UintVar(&f.durableBlocks, "durable-blocks", 2048, "number of blocks per volume on first create (ignored when opening existing)")
|
||||
fs.UintVar(&f.durableBlockSize, "durable-blocksize", 4096, "block size in bytes on first create")
|
||||
|
||||
@@ -148,7 +148,9 @@ type ProviderConfig struct {
|
||||
// disables the timer.
|
||||
ChunkCaptureInterval time.Duration
|
||||
// ChunkDirtyThreshold: an automatic cut is due once this many chunks
|
||||
// are dirty since the last HEAD. Zero disables the threshold. With
|
||||
// are dirty since the last HEAD; it bounds one cut's size rather than
|
||||
// keeping the remote fresh (the remote holds snapshots). Zero disables
|
||||
// the threshold. With
|
||||
// both zero there are no automatic cuts (only CaptureVolume and
|
||||
// MakeVolumeRemoteDurable).
|
||||
ChunkDirtyThreshold int
|
||||
|
||||
Reference in new issue
Block a user