PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

rohansurana2810_190538 avatar image
rohansurana2810_190538 asked ·

Why are results incorrect when searching with PartitionStrategy in DSE 6.8.0?

Hi,

I am using the partition strategy in DSE Enterprise 6.8.0.

I am able to add the data using the partition strategy but when I look up for data in the traversal which uses the partition strategy, it does not return anything but instead it returns the required data when I use the traversal which is without the strategy.

But if I follow the same procedure in DSE 6.7.7 it is working fine(gives required data in the traversal with the partition strategy). I am able to add vertex and search it.

I have added the snippets of the schema, partition strategy, adding data, searching data

Schema:

schema.vertexLabel('Person').
        ifNotExists().
        partitionBy('tenantId',Ascii).
        clusterBy('id',Ascii, Asc).
        property('name',Text).
        create()

Partition Strategy:

gremlin> :remote config alias g test.g
==>g=test.g
gremlin> s = PartitionStrategy.build().partitionKey('tenantId').writePartition('Default').readPartitions('Default').create()
==>PartitionStrategy
gremlin> gA = g.withStrategies(s)
==>test[Core]

Adding data :

gremlin> gA.addV('Person').property('id','rsurana')
==>v[dseg:/Person/Default/rsurana]

Searching Data using traversal with partition strategy:

gremlin> gA.V()
gremlin> 

Searching data using the traversal which is without the strategy:

gremlin> g.V()
==>v[dseg:/Person/Default/rsurana]

As it can be seen, I am getting the output in g.V() instead of gA.V()

dsegraphpartitionstrategy
2 comments
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Observing this issue through gremlin-console in 6.8

0 Likes 0 · ·

@baid_manish_187433 Apologies for the delay on getting a response to your question. We've had a massive number of questions posted in the last week and the public holidays in the US and UK hasn't helped. I've reached out to the Graph team at DataStax on your behalf. Cheers!

0 Likes 0 · ·

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered ·

It looks to me that the alias to the traversal source with strategies does not get set correctly (I will follow up on that.)

In the meantime try the following:

s = PartitionStrategy.build().partitionKey('tenantId').writePartition('Default').readPartitions('Default').create()
s2 = PartitionStrategy.build().partitionKey('tenantId').writePartition('Default2').readPartitions('Default2').create

Then assert the strategy with each query rather than setting a new variable for the traversal source:

g.withStrategies(s).addV('Person').property('id','rsurana')

g.withStrategies(s2).addV('Person').property('id','rsurana2')

Assert the desired strategy with every query:

g.withStrategies(s).V()

g.withStrategies(s2).V()


This now works, here is an example:

gremlin> s = PartitionStrategy.build().partitionKey('tenantId').writePartition('Default').readPartitions('Default').create()
==>PartitionStrategy
gremlin> s2 = PartitionStrategy.build().partitionKey('tenantId').writePartition('Default2').readPartitions('Default2').create()
==>PartitionStrategy
gremlin> g.withStrategies(s).addV('Person').property('id','rsurana')
==>v[dseg:/Person/Default/rsurana]
gremlin> g.withStrategies(s2).addV('Person').property('id','rsurana2')
==>v[dseg:/Person/Default2/rsurana2]
gremlin> g.withStrategies(s).V()
[warn] This traversal could read elements without a label restriction.
This may degrade performance if many element labels are involved. Suggestions:
 - Add hasLabel steps to the traversal where vertices are read or edges traversed.  Examples:
     Instead of V(), use V().hasLabel('vertex_label')
     Instead of out(), use out('edge_label')
 - Suppress this warning by beginning the traversal by g.with("label-warning", false).
==>v[dseg:/Person/Default/rsurana]
gremlin> g.withStrategies(s2).V()
[warn] This traversal could read elements without a label restriction.
This may degrade performance if many element labels are involved. Suggestions:
 - Add hasLabel steps to the traversal where vertices are read or edges traversed.  Examples:
     Instead of V(), use V().hasLabel('vertex_label')
     Instead of out(), use out('edge_label')
 - Suppress this warning by beginning the traversal by g.with("label-warning", false).
==>v[dseg:/Person/Default2/rsurana2]

I will check into the difference to the previous graph version, but I hope this helps.

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.