Discussion Forum

Grakn 2.0, non-idempotent reads

Hi (re-post, previous was in the wrong section)

I am seeing some strange query behavior when running the latest Grakn 2.0 docker image (2.0.0-alpha-9). In short:

  • I execute a read query via the cli client, and I get no results (where I expect some).
  • I then execute a shortened version of the query with fewer constraints, and get some results.
  • And then when I re-execute the first query I get the right results. This is all in a single read transaction.

Once a new transaction is opened, the same behavior can be observed.

These are the three queries, removing the actual results for brevity:

adam-action-graph-v0::data::read> match $current_state isa action;$next (preceding: $current_state, succeeding: $next_state) isa next, has attribute $ta, has story_step 1, has story-name ‘story_4’;

answers: 0, duration: 5 ms

adam-action-graph-v0::data::read> match $current_state isa action;$next (preceding: $current_state, succeeding: $next_state) isa next, has attribute $ta;

answers: 23, duration: 101 ms

adam-action-graph-v0::data::read> match $current_state isa action;$next (preceding: $current_state, succeeding: $next_state) isa next, has attribute $ta, has story_step 1, has story-name ‘story_4’;

answers: 3, duration: 18 ms
adam-action-graph-v0::data::read>

This is my schema:

define
state sub entity, abstract;
start-state sub state;
action-type sub attribute, value string;
action sub state, owns action-type @key;
state plays next:preceding;
action plays next:succeeding;

next sub relation,
relates preceding,
relates succeeding;

is_priority sub attribute, value boolean;
story-name sub attribute, value string;
story_step sub attribute, value long;

next owns is_priority;
next owns story-name;
next owns story_step;
intent sub attribute, value string;
next owns intent;
trigger_handover sub attribute, value boolean;
next owns trigger_handover;
is_priority sub attribute, value boolean;
next owns is_priority;
first_name sub attribute, value string;
next owns first_name;
forget_transitions sub attribute, value long;
next owns forget_transitions;
topic sub attribute, value string;
next owns topic;

I would be happy to provide all of the insert statements to get the same data, if it helps.

Update: I am still seeing non-idempotent reads after upgrading to the release version of Grakn 2.0.0.

Ohhhhh yes please!! Do you have a reproducible issue/data you can share? We’ve been trying to track it down for a while!

I’ve sent a private message with the data to reproduce the issue. Let me know if you have any questions.

Great news, managed to track down the bug based on this and two other reports and it’ll hopefully be released soon! Was a tricky one :smiley:

Nice one, thank you for such a quick turnaround.