Skip to content

Commit d3d313a

Browse files
authored
Make posix-oneshot more snappy. (#752)
Reduces the minimum permissible checkpoint interval in the POSIX storage backend. There's no infra-imposed limit for why this should be set to 1s as there is in GCP.
1 parent 83e4e2d commit d3d313a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cmd/examples/posix-oneshot/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const (
4545
// Since this is a short-lived command-line tool, we set this to a relatively low value so that
4646
// the tool can publish the new checkpoint and exit relatively quickly after integrating the entries
4747
// into the tree.
48-
checkpointInterval = time.Second
48+
checkpointInterval = 100 * time.Millisecond
4949
)
5050

5151
// entryInfo binds the actual bytes to be added as a leaf with a
@@ -96,7 +96,7 @@ func main() {
9696

9797
// We don't want to exit until our entries have been integrated into the tree, so we'll use Tessera's
9898
// PublicationAwaiter to help with that.
99-
await := tessera.NewPublicationAwaiter(ctx, r.ReadCheckpoint, time.Second)
99+
await := tessera.NewPublicationAwaiter(ctx, r.ReadCheckpoint, 100*time.Millisecond)
100100

101101
// Add each of the leaves in order, and store the futures in a slice
102102
// that we will check once all leaves are sent to storage.

storage/posix/files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const (
6262
// treeStateLock must be held when integrating entries into the tree or writing to the treeState file.
6363
treeStateLock = treeStateFile + ".lock"
6464

65-
minCheckpointInterval = time.Second
65+
minCheckpointInterval = 100 * time.Millisecond
6666
)
6767

6868
// Storage implements storage functions for a POSIX filesystem.

0 commit comments

Comments
 (0)