We construct the following scenario: size1 equals count nodes size with random filter; size2 equals negate the former query. Then size1 + size2 should equal to total number of nodes in the graph. We build the graph randomly with 100 vertexes, 200 edges, 20 vertex labels, and 20 edge labels.
Here is one of our bug examples executed.
1) g.V().has('vp3').size() return 42
2) g.V().not(has('vp3')).size() return 42
3) g.V().size() return 100. We noted that 42+42 != 100. In this graph, we should know that there're more result inconsistency than the example I presented above. For example, the node filter operation can be complicated, or we can also count the edges size with random filter like g.E().hasLabel('el2','el1').size(). Specially, we conducted differential testing on other graph databases such as JanusGraph and TinkerPop, and they output the correct results that size1 + size2 = size3.
Bug Type (问题类型)
gremlin (结果不合预期)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
Expected Behavior:
We construct the following scenario: size1 equals count nodes size with random filter; size2 equals negate the former query. Then size1 + size2 should equal to total number of nodes in the graph. We build the graph randomly with 100 vertexes, 200 edges, 20 vertex labels, and 20 edge labels. Here is one of our bug examples executed. 1)
g.V().has('vp3').size()
return 42 2)g.V().not(has('vp3')).size()
return 42 3)g.V().size()
return 100. We noted that 42+42 != 100. In this graph, we should know that there're more result inconsistency than the example I presented above. For example, the node filter operation can be complicated, or we can also count the edges size with random filter likeg.E().hasLabel('el2','el1').size()
. Specially, we conducted differential testing on other graph databases such as JanusGraph and TinkerPop, and they output the correct results that size1 + size2 = size3.Current Behavior: The query 3 return 100!= 42+42.
Steps to Reproduce:
Create schema
schema().vertexLabel('vl0').ifNotExist().create(); schema().vertexLabel('vl0').properties('vp3').nullableKeys('vp3').append(); schema().indexLabel('vl0byvp3Shard').onV('vl0').by('vp3').shard().ifNotExist().create(); schema().vertexLabel('vl1').ifNotExist().create(); schema().vertexLabel('vl1').properties('vp0').nullableKeys('vp0').append(); schema().indexLabel('vl1byvp0Shard').onV('vl1').by('vp0').shard().ifNotExist().create(); schema().vertexLabel('vl1').properties('vp3').nullableKeys('vp3').append(); schema().indexLabel('vl1byvp3Shard').onV('vl1').by('vp3').shard().ifNotExist().create(); schema().vertexLabel('vl1').properties('vp2').nullableKeys('vp2').append(); schema().indexLabel('vl1byvp2Shard').onV('vl1').by('vp2').shard().ifNotExist().create(); schema().vertexLabel('vl2').ifNotExist().create(); schema().vertexLabel('vl2').properties('vp1').nullableKeys('vp1').append(); schema().indexLabel('vl2byvp1Shard').onV('vl2').by('vp1').shard().ifNotExist().create(); schema().vertexLabel('vl2').properties('vp0').nullableKeys('vp0').append(); schema().indexLabel('vl2byvp0Shard').onV('vl2').by('vp0').shard().ifNotExist().create(); schema().vertexLabel('vl2').properties('vp2').nullableKeys('vp2').append(); schema().indexLabel('vl2byvp2Shard').onV('vl2').by('vp2').shard().ifNotExist().create(); schema().vertexLabel('vl3').ifNotExist().create(); schema().vertexLabel('vl3').properties('vp0').nullableKeys('vp0').append(); schema().indexLabel('vl3byvp0Shard').onV('vl3').by('vp0').shard().ifNotExist().create();
schema().propertyKey('ep0').asText().ifNotExist().create(); schema().propertyKey('ep1').asInt().ifNotExist().create(); schema().propertyKey('ep2').asFloat().ifNotExist().create(); schema().propertyKey('ep3').asInt().ifNotExist().create(); schema().propertyKey('ep4').asText().ifNotExist().create(); schema().propertyKey('ep5').asText().ifNotExist().create(); schema().propertyKey('ep6').asFloat().ifNotExist().create(); schema().propertyKey('ep7').asInt().ifNotExist().create();
schema().edgeLabel('el0').link('vl0', 'vl2').ifNotExist().create(); schema().edgeLabel('el0').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el0byep6Shard').onE('el0').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep5').nullableKeys('ep5').append(); schema().indexLabel('el0byep5Shard').onE('el0').by('ep5').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep2').nullableKeys('ep2').append(); schema().indexLabel('el0byep2Shard').onE('el0').by('ep2').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el0byep1Shard').onE('el0').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el0byep0Shard').onE('el0').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el1').link('vl2', 'vl2').ifNotExist().create(); schema().edgeLabel('el1').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el1byep1Shard').onE('el1').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el1').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el1byep0Shard').onE('el1').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el1').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el1byep7Shard').onE('el1').by('ep7').shard().ifNotExist().create(); schema().edgeLabel('el1').properties('ep5').nullableKeys('ep5').append(); schema().indexLabel('el1byep5Shard').onE('el1').by('ep5').shard().ifNotExist().create(); schema().edgeLabel('el2').link('vl0', 'vl1').ifNotExist().create(); schema().edgeLabel('el2').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el2byep7Shard').onE('el2').by('ep7').shard().ifNotExist().create(); schema().edgeLabel('el3').link('vl0', 'vl1').ifNotExist().create(); schema().edgeLabel('el3').properties('ep3').nullableKeys('ep3').append(); schema().indexLabel('el3byep3Shard').onE('el3').by('ep3').shard().ifNotExist().create(); schema().edgeLabel('el3').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el3byep1Shard').onE('el3').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el3').properties('ep5').nullableKeys('ep5').append(); schema().indexLabel('el3byep5Shard').onE('el3').by('ep5').shard().ifNotExist().create(); schema().edgeLabel('el3').properties('ep4').nullableKeys('ep4').append(); schema().indexLabel('el3byep4Shard').onE('el3').by('ep4').shard().ifNotExist().create(); schema().edgeLabel('el3').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el3byep7Shard').onE('el3').by('ep7').shard().ifNotExist().create(); schema().edgeLabel('el4').link('vl1', 'vl3').ifNotExist().create(); schema().edgeLabel('el4').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el4byep7Shard').onE('el4').by('ep7').shard().ifNotExist().create(); schema().edgeLabel('el4').properties('ep4').nullableKeys('ep4').append(); schema().indexLabel('el4byep4Shard').onE('el4').by('ep4').shard().ifNotExist().create(); schema().edgeLabel('el4').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el4byep6Shard').onE('el4').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el5').link('vl0', 'vl1').ifNotExist().create(); schema().edgeLabel('el5').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el5byep0Shard').onE('el5').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el5').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el5byep1Shard').onE('el5').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el6').link('vl1', 'vl0').ifNotExist().create(); schema().edgeLabel('el6').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el6byep6Shard').onE('el6').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el6').properties('ep2').nullableKeys('ep2').append(); schema().indexLabel('el6byep2Shard').onE('el6').by('ep2').shard().ifNotExist().create(); schema().edgeLabel('el6').properties('ep3').nullableKeys('ep3').append(); schema().indexLabel('el6byep3Shard').onE('el6').by('ep3').shard().ifNotExist().create(); schema().edgeLabel('el6').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el6byep0Shard').onE('el6').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el6').properties('ep4').nullableKeys('ep4').append(); schema().indexLabel('el6byep4Shard').onE('el6').by('ep4').shard().ifNotExist().create(); schema().edgeLabel('el7').link('vl0', 'vl3').ifNotExist().create(); schema().edgeLabel('el7').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el7byep6Shard').onE('el7').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el7').properties('ep3').nullableKeys('ep3').append(); schema().indexLabel('el7byep3Shard').onE('el7').by('ep3').shard().ifNotExist().create(); schema().edgeLabel('el7').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el7byep0Shard').onE('el7').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el7').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el7byep1Shard').onE('el7').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el7').properties('ep2').nullableKeys('ep2').append(); schema().indexLabel('el7byep2Shard').onE('el7').by('ep2').shard().ifNotExist().create(); schema().edgeLabel('el8').link('vl3', 'vl1').ifNotExist().create(); schema().edgeLabel('el8').properties('ep3').nullableKeys('ep3').append(); schema().indexLabel('el8byep3Shard').onE('el8').by('ep3').shard().ifNotExist().create(); schema().edgeLabel('el8').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el8byep7Shard').onE('el8').by('ep7').shard().ifNotExist().create(); schema().edgeLabel('el8').properties('ep4').nullableKeys('ep4').append(); schema().indexLabel('el8byep4Shard').onE('el8').by('ep4').shard().ifNotExist().create(); schema().edgeLabel('el8').properties('ep5').nullableKeys('ep5').append(); schema().indexLabel('el8byep5Shard').onE('el8').by('ep5').shard().ifNotExist().create(); schema().edgeLabel('el8').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el8byep6Shard').onE('el8').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el9').link('vl2', 'vl2').ifNotExist().create(); schema().edgeLabel('el9').properties('ep6').nullableKeys('ep6').append(); schema().indexLabel('el9byep6Shard').onE('el9').by('ep6').shard().ifNotExist().create(); schema().edgeLabel('el9').properties('ep1').nullableKeys('ep1').append(); schema().indexLabel('el9byep1Shard').onE('el9').by('ep1').shard().ifNotExist().create(); schema().edgeLabel('el9').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el9byep0Shard').onE('el9').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el9').properties('ep3').nullableKeys('ep3').append(); schema().indexLabel('el9byep3Shard').onE('el9').by('ep3').shard().ifNotExist().create(); schema().edgeLabel('el9').properties('ep7').nullableKeys('ep7').append(); schema().indexLabel('el9byep7Shard').onE('el9').by('ep7').shard().ifNotExist().create();
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response