Indexes doesn't work after migration to 1.7rc2
We have found a problem that has surfaced in one of our modules where a query is not working correctly. I have attached the database and below are the queries demonstrating the problem.
orientdb {xxx}> select jobId, status, username from exception_processing_module-BSM_exception_record
----+------+-----+--------+--------
# |@RID |jobId|status |username
----+------+-----+--------+--------
0 |#-2:1 |1 |original|joe
1 |#-2:2 |1 |original|joe
2 |#-2:3 |1 |original|joe
3 |#-2:4 |1 |original|joe
4 |#-2:5 |1 |original|joe
5 |#-2:6 |1 |original|joe
6 |#-2:7 |1 |original|joe
7 |#-2:8 |1 |original|joe
8 |#-2:9 |1 |original|joe
9 |#-2:10|1 |original|joe
10 |#-2:11|1 |original|joe
11 |#-2:12|1 |original|joe
12 |#-2:13|1 |original|joe
13 |#-2:14|1 |original|joe
14 |#-2:15|1 |original|joe
15 |#-2:16|1 |original|joe
16 |#-2:17|1 |original|joe
17 |#-2:18|1 |original|joe
18 |#-2:19|1 |original|joe
19 |#-2:20|1 |original|joe
----+------+-----+--------+--------
LIMIT EXCEEDED: resultset contains more items not displayed (limit=20)
20 item(s) found. Query executed in 0.054 sec(s).
orientdb {xxx}> select jobId, status, username from exception_processing_module-BSM_exception_record where username='joe'
0 item(s) found. Query executed in 0.001 sec(s).
orientdb {xxx}>
As you can see, the username column clearly has ‘joe’ in the column, but no records come back when querying based on that column. If I query based on another column, it works fine. I remember a similar issue in a previous version that had gotten fixed.
Here are the steps that got us to this point:
-
Add records (5475 records were added and with column username set to ’admin’) -
Bulk update of all these records to have the username field set to ‘joe’ -
Run query where username=’joe’ -
Incorrect results are returned
After the rebuild of the index "exception_processing_module-BSM_exception_record0_idx" everything worked. So seems a migration problem with old database. Until we find the cause, I suggest one of these solutions:
- export+import the database
- replace the jars with last version, but rebuild all the indexes
Rob says that the database has been created from scratch. So I tried to execute a massive update with:
update exception_processing_module-BSM_exception_record set username='luca'
And then:
select jobId, status, username from exception_processing_module-BSM_exception_record where username='luca'
But worked perfectly.
Were you running clustered? I was told by the team doing this functionality that this works running non-clustered. I did the bulk update with 2 nodes. Sorry, thought I had that in the original email.
@lvca It is distributed storage issue, so assign it to you.
It's distributed, gotcha. I get the database you sent me again and retry with 2 servers.
I have a test app that reproduces the problem we are seeing. Basically, it creates an entry, then updates it by changing the ‘username’ field (not a bulk update). If I have the index defined in line 160, the “updatedUsername count” stays at 0 because the query doesn’t return the correct results. If I comment out that line, the updatedUsername count is correct. I was told by the folks working on this area of the code that this was broken in 1.6.2 but fixed in 1.6.3 which is why we had a test app doing this functionality in the first place. Could there be something that didn’t make it back into the ‘develop’ branch from 1.6.3?
From: Andrey Lomakin [mailto:[email protected]] Sent: Wednesday, March 26, 2014 1:46 AM To: orientechnologies/orientdb Cc: Robbin L. Gratz Subject: Re: [orientdb] Indexes doesn't work after migration to 1.7rc2 (#2163)
@lvcahttps://github.com/lvca It is distributed storage issue, so assign it to you.
— Reply to this email directly or view it on GitHubhttps://github.com/orientechnologies/orientdb/issues/2163#issuecomment-38654285.
Hi Rob, Please could you send us the test case? I tried to reproduce a single update on your old database, but seems to work like a charm.
Any word on this? It's been almost 2 weeks.
Rob, is this still valid or has been fixed by last commits?
It looks like this is fixed in the latest 1.7-SNAPSHOT build. Thanks.
From: Luca Garulli [mailto:[email protected]] Sent: Wednesday, May 07, 2014 2:51 AM To: orientechnologies/orientdb Cc: Robbin L. Gratz Subject: Re: [orientdb] Indexes doesn't work after migration to 1.7rc2 (#2163)
Rob, is this valid yet?
— Reply to this email directly or view it on GitHubhttps://github.com/orientechnologies/orientdb/issues/2163#issuecomment-42398681.