Skip to content

No function clause matching Swarm.IntervalTreeClock.sum/2 #141

@balena

Description

@balena

I'm using Swarm in a big cluster and I'm always getting the following error in exactly one node:

00:34:51.845 [error] GenStateMachine Swarm.Tracker terminating
** (FunctionClauseError) no function clause matching in Swarm.IntervalTreeClock.sum/2
    (swarm 3.4.0) lib/swarm/tracker/crdt.ex:140: Swarm.IntervalTreeClock.sum(1, {0, 1})
    (swarm 3.4.0) lib/swarm/tracker/crdt.ex:29: Swarm.IntervalTreeClock.join/2
    (swarm 3.4.0) lib/swarm/tracker/tracker.ex:1005: Swarm.Tracker.handle_replica_event/4
    (stdlib 3.13) gen_statem.erl:1166: :gen_statem.loop_state_callback/11
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Basically it is attempting to join two interval tree clocks 1 and {0, 1}, which, apparently by definition, is undefined. The ITC 1 is coming from the %TrackerState which holds a clock with this value 1.

Either the ITC is missing a definition for this case or the Swarm code is saving 1 in %TrackerState.clock in a wrong way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions