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

2.1-RC3: Error on executing distributed request for counter: Quorum 2 not reached for request (but it is?) #4316

Closed
alexpmorris opened this issue Jun 6, 2015 · 8 comments
Assignees
Labels
Milestone

Comments

@alexpmorris
Copy link

I was trying to put together a short java demo/test case for a distributed chat application, and I've been coming up with the following error with OrientDB 2.1-RC3. Write Quorum is set to 2. The response received would indicate both databases are in sync, yet the error persists. I also tried changing the Conflict Strategy on the class to version, content, and automerge, all with the same result.

ALSO NOTE, that while an exception is thrown each time, the field IS still properly incremented each time:

com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=82 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) against database 'chat.[]' to nodes [db001, db000]
--> com.orientechnologies.orient.server.distributed.ODistributedException: Quorum 2 not reached for request (id=82 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0). Elapsed=15ms Servers in timeout/conflict are: - db001: [{value:33}] Received: {db000=[{value:33}], db001=[{value:33}]}

com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=82 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) against database 'chat.[]' to nodes [db001, db000]
--> com.orientechnologies.orient.server.distributed.ODistributedException: Quorum 2 not reached for request (id=82 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0). Elapsed=15ms Servers in timeout/conflict are: - db001: [{value:34}] Received: {db000=[{value:34}], db001=[{value:34}]}

@alexpmorris alexpmorris changed the title Error on executing distributed request for counter: Quorum 2 not reached for request (but it is?) 2.1-RC3: Error on executing distributed request for counter: Quorum 2 not reached for request (but it is?) Jun 6, 2015
@lvca lvca added the bug label Jun 12, 2015
@lvca lvca self-assigned this Jun 12, 2015
@lvca lvca added this to the 2.1 GA milestone Jun 12, 2015
@lvca
Copy link
Member

lvca commented Jun 12, 2015

Could you please try with last 2.1-SNAPSHOT?

@alexpmorris
Copy link
Author

I tried with the latest snapshot and the problem is still there. HOWEVER, the latest snapshot listed is orientdb-community-2.1-20150610.173559-189-distribution.zip

So I'll try again when the next update shows up for today's date or better.

@alexpmorris
Copy link
Author

just tried the latest version from orientdb-community-2.1-20150616.215843-194-distribution.zip

Unfortunately, same result, and I still received the same error message.

@alexpmorris
Copy link
Author

I found some more warning messages that could perhaps help better diagnose the problem:

2015-06-16 19:56:35:088 WARNING [db000] detected 1 node(s) in timeout or in conflict and quorum (2) has not been reached, rolling back changes for request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) [ODistributedResponseManager]

2015-06-16 19:56:35:088 WARNING [db000] Quorum 2 not reached for request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0). Elapsed=16ms Servers in timeout/conflict are: - db000: [{value:52}] Received: {db000=[{value:52}], db001=[{value:52}]} [ODistributedResponseManager]

2015-06-16 19:56:35:088 WARNING [db000] sending undo message for request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) to server db000 [ODistributedResponseManager]

2015-06-16 19:56:35:088 WARNING [db000] sending undo message for request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) to server db001 [ODistributedResponseManager]

2015-06-16 19:56:35:088 SEVERE Internal server error: com.orientechnologies.orient.server.distributed.ODistributedException: Error on executing distributed request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0) against database 'chat.[]' to nodes [db001, db000] --> com.orientechnologies.orient.server.distributed.ODistributedException: Quorum 2 not reached for request (id=10 from=db000 task=command_sql(UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1') user=#5:0). Elapsed=16ms Servers in timeout/conflict are: - db000: [{value:52}] Received: {db000=[{value:52}], db001=[{value:52}]} [ONetworkProtocolHttpDb]

@alexpmorris
Copy link
Author

After some additional testing, it seems as if the problem is related to this part of the SQL query:

RETURN AFTER $current.counter

because when I queried just the following (without asking for the new value to be returned), I received NO error and everything appeared to work correctly:

UPDATE ChatCounters INCREMENT counter=1 WHERE name='counter1'

@lvca lvca modified the milestones: 2.1 GA, 2.1.1 Aug 5, 2015
@lvca lvca modified the milestones: 2.1.1, 2.1.x (next hotfix) Aug 31, 2015
@lvca
Copy link
Member

lvca commented Nov 19, 2015

As workaround, could you use this?

UPDATE ChatCounters INCREMENT counter=1 WHERE name='counter1' RETURN AFTER $current

And get the counter from the record?

@alexpmorris
Copy link
Author

I tried banging away a bunch of times with the latest 2.2 snapshot, and it didn't give me the error this time for either "RETURN AFTER $current" or "RETURN AFTER $current.counter". One thing though, in case it's a bug, if RETURN is after WHERE as in your statement, I get an error:

FAILS:
UPDATE ChatCounters INCREMENT counter=1 WHERE name='counter1' RETURN AFTER $current

com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: Encountered " <RETURN> "RETURN "" at line 1, column 63.
 Was expecting one of:
 <EOF> 
 <AND> ...
 <OR> ...
 <LIMIT> ...
 <TIMEOUT> ...
 <LOCK> ...
 ";" ...

This seems to work now (as does "RETURN AFTER $current"):
UPDATE ChatCounters INCREMENT counter=1 RETURN AFTER $current.counter WHERE name='counter1'

@lvca
Copy link
Member

lvca commented Nov 22, 2015

My mistake the RETURN must go before the WHERE as from docs.

@lvca lvca closed this as completed Nov 22, 2015
@lvca lvca modified the milestones: 2.2, 2.1.x (next hotfix) Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants