Skip to content

Commit

Permalink
Update comment for NondeterministicFastCommit
Browse files Browse the repository at this point in the history
Make it clearer that encoded slabs are still deterministic, so
array and map iterations will remain deterministic.

Only the sequence of changed slabs getting committed is
nondeterministic.

This is useful for migration programs that don't require
commit sequence of slabs to be deterministic while
still preserving deterministic encoding of slabs
(e.g. iteration of arrays and maps remain deterministic).
  • Loading branch information
fxamacker authored May 24, 2024
1 parent 688791c commit 8db2824
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,10 @@ func (s *PersistentSlabStorage) FastCommit(numWorkers int) error {
return nil
}

// NondeterministicFastCommit commits changes in nondeterministic order.
// This is used by migration program when ordering isn't required.
// NondeterministicFastCommit commits changed slabs in nondeterministic order.
// Encoded slab data is deterministic (e.g. array and map iteration is deterministic).
// IMPORTANT: This function is used by migration programs when commit order of slabs
// is not required to be deterministic (while preserving deterministic array and map iteration).
func (s *PersistentSlabStorage) NondeterministicFastCommit(numWorkers int) error {
// No changes
if len(s.deltas) == 0 {
Expand Down

0 comments on commit 8db2824

Please sign in to comment.