-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Using sets as an example: the current result of an empty convergent set is
(def set1 (with-node :node1 (convergent-set)))
;; => #schism/set[#{} {} {}]
Whereas if a set is initialised with some state is
(def set2 (with-node :node2 (convergent-set :a)))
;; => => #schism/set[#{:a} {:node2 #inst"..."} {:a [:node2 #inst"..."]}]
I found this caused problems when you try to merge the second into the empty set
(with-node :node1 (converge set1 set2))
;; => Execution error (NullPointerException) at schism.impl.core/to-millis.
Because the first set is missing a vector clock.
Should convergent data structures be initialised with a vector clock in all cases? Changing the initialisation with
-(defn new-set
- ([] (Set. (hash-set)
- (hash-map)
- (hash-map)))
+ (defn new-set
+ ([] (vc/update-clock now nil
+ (Set. (hash-set)
+ (hash-map)
+ (hash-map)))) ChrisBronkhorst
Metadata
Metadata
Assignees
Labels
No labels