From 8db28245e4e2057d2e30064a4ea5419d003e24c5 Mon Sep 17 00:00:00 2001 From: Faye Amacker <33205765+fxamacker@users.noreply.github.com> Date: Fri, 24 May 2024 09:51:16 -0500 Subject: [PATCH] Update comment for NondeterministicFastCommit 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). --- storage.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage.go b/storage.go index 3270f97..001984e 100644 --- a/storage.go +++ b/storage.go @@ -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 {