orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Distributed: INSERT creates multiple records

Open nethertek opened this issue 12 years ago • 11 comments

orientdb {db=test}> create class SMS;
Class created successfully. Total classes in database now: 11

orientdb {db=test}> insert into sms (type, lang, source, content) values ( 'notify', 'en', 1, 'This is a test');
Inserted record 'SMS#23:0{type:notify,lang:en,source:1,content:This is a test} v1' in 0.003000 sec(s).

orientdb {db=test}> select * from sms;

----+-----+------+------+----+------+--------------
#   |@RID |@CLASS|type  |lang|source|content       
----+-----+------+------+----+------+--------------
0   |#23:0|SMS   |notify|en  |1     |This is a test
1   |#23:1|SMS   |notify|en  |1     |This is a test
----+-----+------+------+----+------+--------------

2 item(s) found. Query executed in 0.001 sec(s).

nethertek avatar Oct 22 '14 08:10 nethertek

What version?

lvca avatar Oct 22 '14 15:10 lvca

Latest 2.0 SNAPSHOT

nethertek avatar Oct 22 '14 16:10 nethertek

Did you use "remote:" protocol?

lvca avatar Nov 08 '14 12:11 lvca

Yes

nethertek avatar Nov 08 '14 13:11 nethertek

Fixed in the last 2.0-SNAPSHOT. Please can you check it?

lvca avatar Dec 03 '14 18:12 lvca

I started with the latest SNAPSHOT and a fresh database. INSERT still creates two records. One for each node I presume.

Inserted record 'SMS#18:0{type:notify,lang:en,source:1,content:This is a test} v1' in 0.635000 sec(s).

orientdb {db=test}>  select * from SMS;

----+-----+------+------+----+------+--------------
#   |@RID |@CLASS|type  |lang|source|content       
----+-----+------+------+----+------+--------------
0   |#18:0|SMS   |notify|en  |1     |This is a test
1   |#18:1|SMS   |notify|en  |1     |This is a test
----+-----+------+------+----+------+--------------

2 item(s) found. Query executed in 0.243 sec(s).
orientdb {db=test}> insert into sms (type, lang, source, content) values ( 'notify', 'en', 1, 'This is a test');

Inserted record 'SMS#18:2{type:notify,lang:en,source:1,content:This is a test} v1' in 0.001000 sec(s).

orientdb {db=test}>  select * from SMS;                                                                         

----+-----+------+------+----+------+--------------
#   |@RID |@CLASS|type  |lang|source|content       
----+-----+------+------+----+------+--------------
0   |#18:0|SMS   |notify|en  |1     |This is a test
1   |#18:1|SMS   |notify|en  |1     |This is a test
2   |#18:2|SMS   |notify|en  |1     |This is a test
3   |#18:3|SMS   |notify|en  |1     |This is a test
----+-----+------+------+----+------+--------------

4 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=test}> 

nethertek avatar Dec 08 '14 09:12 nethertek

I tried and works correctly. My console:

MacBook-Pro:bin luca$ ./console.sh

OrientDB console v.2.0-SNAPSHOT (build 2568) www.orientechnologies.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb> connect remote:localhost/GratefulDeadConcerts admin admin

Connecting to database [remote:localhost/GratefulDeadConcerts] with user 'admin'...OK

DISTRIBUTED CONFIGURATION:
{
  "members": [{
      "id": "0a26fe6a-4f3c-4a09-a086-1be579a35fe6",
      "name": "node1418142450964",
      "startedOn": "2014-12-09 16:27:29",
      "listeners": [{"protocol":"ONetworkProtocolBinary","listen":"10.3.15.55:2424"},{"protocol":"ONetworkProtocolHttpDb","listen":"10.3.15.55:2480"}],
      "databases": []
      },{
      "id": "532a884c-d5e7-4066-a01c-7986c2cd0683",
      "name": "root",
      "startedOn": "2014-12-09 16:27:41",
      "listeners": [{"protocol":"ONetworkProtocolBinary","listen":"10.3.15.55:2425"},{"protocol":"ONetworkProtocolHttpDb","listen":"10.3.15.55:2481"}],
      "databases": []
      }
  ],
  "localName": "_hzInstance_1_orientdb",
  "localId": "0a26fe6a-4f3c-4a09-a086-1be579a35fe6"
}

orientdb {db=GratefulDeadConcerts}> create class SMS

Class created successfully. Total classes in database now: 13

orientdb {db=GratefulDeadConcerts}> insert into sms (type, lang, source, content) values ( 'notify', 'en', 1, 'This is a test');

Inserted record 'SMS#21:0{type:notify,lang:en,source:1,content:This is a test} v1' in 0,012000 sec(s).

orientdb {db=GratefulDeadConcerts}> select from SMS

----+-----+------+------+----+------+--------------
#   |@RID |@CLASS|type  |lang|source|content
----+-----+------+------+----+------+--------------
0   |#21:0|SMS   |notify|en  |1     |This is a test
----+-----+------+------+----+------+--------------

1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=GratefulDeadConcerts}>

lvca avatar Dec 09 '14 16:12 lvca

Perhaps executionMode asynchronous causing the problem?

{
    "autoDeploy": true,
    "hotAlignment": false,
    "executionMode": "asynchronous",
    "readQuorum": 1,
    "writeQuorum": 1,
    "failureAvailableNodesLessQuorum": false,
    "readYourWrites": true,
    "clusters": {
        "internal": {
        },
        "index": {
        },
        "*": {
            "servers" : [ "<NEW_NODE>" ]
        }
    }
}

nethertek avatar Dec 09 '14 17:12 nethertek

Confirm, with asynchronous this problem appears. Reopening it...

lvca avatar Dec 09 '14 17:12 lvca

Closed. Please retry with last.

lvca avatar Dec 09 '14 18:12 lvca

Confirmed, this problem appears fixed.

nethertek avatar Dec 10 '14 09:12 nethertek