Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's possible to have shards and unique indexes? #3939

Closed
vitorenesduarte opened this issue Apr 16, 2015 · 3 comments
Closed

It's possible to have shards and unique indexes? #3939

vitorenesduarte opened this issue Apr 16, 2015 · 3 comments
Assignees
Milestone

Comments

@vitorenesduarte
Copy link
Contributor

Hi,
I was testing how the indexes behave with shards and noticed that is possible to have two records with the same unique property.
My schema:

ALTER DATABASE MINIMUMCLUSTERS 3

create class User extends V
create property User.name string
create index User.name unique
alter cluster user_0 name user_usa
alter cluster user_1 name user_eur
alter cluster user_2 name user_chi

This code will reproduce it.
The output is:

0 : ok
1 : ok
2 : ok
3 : ko -> result : [mike, mike]
4 : ko -> result : [mike, mike]
5 : ko -> result : [mike, mike]

Start first node usa so that its port is 2424. Then eur -> 2425. Then chi -> 2426.

After the first insert (on chi node), I believe this is what happens:

  • Node eur see that it does not have a record with name mike and asks node usa if it has, but it doesn't (only chi node has a record with name mike).
  • As writeQuorum is 2, the record is inserted.

My question is: if it's an unique index, shouldn't the writeQuorum be disrespected, and check all nodes?

v2.0.7
Logs:

@lvca lvca self-assigned this Apr 25, 2015
@lvca
Copy link
Member

lvca commented Sep 22, 2015

This is not supported yet.

@lvca lvca added this to the 3.0 milestone Sep 22, 2015
@lvca
Copy link
Member

lvca commented Apr 23, 2016

This will be supported in v3.0 with the autosharded index. In v2.2 we already have a local implementation, in v3.0 will be supported in distributed mode to have a regular DHT.

@lvca lvca modified the milestones: 3.1, 3.0 Aug 3, 2017
@hossein-md
Copy link

Hi @lvca
I have tried this issue to reproduce the result with the version 2.2.33. I can't!
But I could after I had changed my Orientdb version to 2.0.7.
I don't understand why it happens. ( This is my problem that I mention in #8234 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants