You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to run your test case but I don't see errors:
insert result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#1:0"}
insert result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:0"}
update result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#1:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#1:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:0"}
Process finished with exit code 0
2023-06-07 08:31:35.073 INFO [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server v23.5.1-SNAPSHOT (build 5412036f00b3f2a91c31c83174a14e032e19b85c/1685452164158/main) is starting up...
2023-06-07 08:31:35.084 INFO [ArcadeDBServer] <ArcadeDB_0> Running on Windows 10 10.0 - OpenJDK 64-Bit Server VM 11.0.12 (Corretto-11.0.12.7.1)
2023-06-07 08:31:35.085 INFO [ArcadeDBServer] <ArcadeDB_0> Starting ArcadeDB Server in development mode with plugins [] ...
2023-06-07 08:31:35.174 INFO [ArcadeDBServer] <ArcadeDB_0> - JMX Metrics Started...
2023-06-07 08:31:35.387 INFO [HttpServer] <ArcadeDB_0> - Starting HTTP Server (host=0.0.0.0 port=2480-2489 httpsPort=2490-2499)...
2023-06-07 08:31:35.969 INFO [HttpServer] <ArcadeDB_0> - HTTP Server started (host=0.0.0.0 port=2480 httpsPort=2490)
2023-06-07 08:31:35.970 INFO [ArcadeDBServer] <ArcadeDB_0> Available query languages: [sqlscript, java, js, sql]
2023-06-07 08:31:35.973 INFO [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server started in 'development' mode (CPUs=8 MAXRAM=3.93GB)
2023-06-07 08:31:35.973 INFO [ArcadeDBServer] <ArcadeDB_0> Studio web tool available at http://172.21.32.1:2480
insert result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:0"}
insert result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:1"}
update result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#2:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#2:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:1"}
Exception in thread "main" org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:180)
at eu.serco.csrs.persistence.ArcadeDBTest.testWhereAfterUpdate(ArcadeDBTest.java:195)
at eu.serco.csrs.persistence.ArcadeDBTest.main(ArcadeDBTest.java:67)
In my test class, line 195 is: Assertions.assertTrue(resultSet.hasNext());
Pulled the latest snapshot, run clean + install, re-compiled my Test class, and it still fails:
2023-06-07 08:45:40.746 INFO [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server v23.5.1-SNAPSHOT (build 3a5380ee1e5fe0a7514bf74119a901b09380c1e7/1686119608920/main) is starting up...
2023-06-07 08:45:40.754 INFO [ArcadeDBServer] <ArcadeDB_0> Running on Windows 10 10.0 - OpenJDK 64-Bit Server VM 11.0.12 (Corretto-11.0.12.7.1)
2023-06-07 08:45:40.756 INFO [ArcadeDBServer] <ArcadeDB_0> Starting ArcadeDB Server in development mode with plugins [] ...
2023-06-07 08:45:40.837 INFO [ArcadeDBServer] <ArcadeDB_0> - JMX Metrics Started...
2023-06-07 08:45:41.052 INFO [HttpServer] <ArcadeDB_0> - Starting HTTP Server (host=0.0.0.0 port=2480-2489 httpsPort=2490-2499)...
2023-06-07 08:45:41.573 INFO [HttpServer] <ArcadeDB_0> - HTTP Server started (host=0.0.0.0 port=2480 httpsPort=2490)
2023-06-07 08:45:41.574 INFO [ArcadeDBServer] <ArcadeDB_0> Available query languages: [sqlscript, java, js, sql]
2023-06-07 08:45:41.575 INFO [ArcadeDBServer] <ArcadeDB_0> ArcadeDB Server started in 'development' mode (CPUs=8 MAXRAM=3.93GB)
2023-06-07 08:45:41.575 INFO [ArcadeDBServer] <ArcadeDB_0> Studio web tool available at http://172.21.32.1:2480
insert result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:0"}
insert result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:1"}
update result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#2:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557014764069841000,"vstop":1557014877423797000,"id":1,"status":"COMPLETED","@cat":"d","@type":"Order","@rid":"#2:0"}
select result = {"processor":"SIR1LRM-7.1","vstart":1557015037288211000,"vstop":1557015158236835000,"id":2,"status":"PENDING","@cat":"d","@type":"Order","@rid":"#2:1"}
Exception in thread "main" org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:180)
at eu.serco.csrs.persistence.ArcadeDBTest.testWhereAfterUpdate(ArcadeDBTest.java:195)
at eu.serco.csrs.persistence.ArcadeDBTest.main(ArcadeDBTest.java:67)
It passes if I run it using Maven from the arcadedb project.
It passes also if I copy it and paste it into my project.
But my test case fails, so now I need to find out what's different between the two methods.
The only difference between my test case and yours is that I create all the database schema objects in a transaction scope, but you don't.
Sure enough, if I move the type and index creation code out of the transaction scope, the test passes.
Why does this happens? The code examples in the manual show how to create types and it is always done inside a transaction.
Tried to remove the transaction from my Project, and it still does not work.
After the update, the select query using WHERE = 'PENDING' does not work, however if I modify it to use WHERE LIKE 'PENDING%' it works. Does LIKE not use the index?
Wait, it gets even weirder.
Out of sheer desperation, I have tried changing things that shouldn't have anything to do with the issue.
I have replaced the value PENDING with the value ELIGIBLE and now everything works, with or without transaction.
Is there something special about the way the value PENDING is interpreted by the engine?
In my Project I create a temporary index before inserting a lot of records and then I delete the index; I didn't include it in the test case because I forgot about the constraint about the UPSERT.
Anyway, I have added dtOrders.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "processor", "vstart", "vstop"); to the test case
and it does not work if I create the db schema objects inside a transaction, but it works if I create them outside of a transaction.
It looks like that constraint was never applied in OrientDB, then ArcadeDB. So nevermind about the UPSERT. The point here is that the failing query is using a composite index with a partial key and fails. Checking on it.
Found the issue. The LSMTreeCursor, at build time, checks if the cursor is valid, but when it finds out that the 1st entry has been updated, it didn't continue with the next element. Fixed the issue locally, waiting to check for any regressions.
Activity
lvca commentedon Jun 6, 2023
Trying to run your test case but I don't see errors:
vic0824 commentedon Jun 7, 2023
It's weird, it fails for me:
In my test class, line 195 is:
Assertions.assertTrue(resultSet.hasNext());vic0824 commentedon Jun 7, 2023
Pulled the latest snapshot, run clean + install, re-compiled my Test class, and it still fails:
lvca commentedon Jun 8, 2023
Could you please run the test
com.arcadedb.server.CompositeIndexTest?vic0824 commentedon Jun 8, 2023
It passes if I run it using Maven from the arcadedb project.
It passes also if I copy it and paste it into my project.
But my test case fails, so now I need to find out what's different between the two methods.
vic0824 commentedon Jun 8, 2023
The only difference between my test case and yours is that I create all the database schema objects in a transaction scope, but you don't.
Sure enough, if I move the type and index creation code out of the transaction scope, the test passes.
Why does this happens? The code examples in the manual show how to create types and it is always done inside a transaction.
vic0824 commentedon Jun 9, 2023
Tried to remove the transaction from my Project, and it still does not work.
After the update, the select query using
WHERE = 'PENDING'does not work, however if I modify it to useWHERE LIKE 'PENDING%'it works. Does LIKE not use the index?lvca commentedon Jun 9, 2023
This issue is getting more interesting :-) I'm checking to see what's going on.
vic0824 commentedon Jun 9, 2023
Wait, it gets even weirder.
Out of sheer desperation, I have tried changing things that shouldn't have anything to do with the issue.
I have replaced the value PENDING with the value ELIGIBLE and now everything works, with or without transaction.
Is there something special about the way the value PENDING is interpreted by the engine?
lvca commentedon Jun 9, 2023
No, pending is not a keyword... I'm debugging the 1st simple case where you create the schema in a tx.
vic0824 commentedon Jun 9, 2023
False alarm, I have tried again and it fails also with ELIGIBLE.
lvca commentedon Jun 9, 2023
I see you use this UPSERT:
But it shouldn't be allowed because it requires the WHERE condition to use the index. Look at the docs (UPSERT limitation paragraph):
https://docs.arcadedb.com/#SQL-Update
So I'm surprised the SQL engine swallows the syntax without any error.
lvca commentedon Jun 9, 2023
Checked the OrientDB code and it's the same. I'm wondering if a syntax check is totally missing here.
vic0824 commentedon Jun 9, 2023
In my Project I create a temporary index before inserting a lot of records and then I delete the index; I didn't include it in the test case because I forgot about the constraint about the UPSERT.
Anyway, I have added
dtOrders.createTypeIndex(Schema.INDEX_TYPE.LSM_TREE, true, "processor", "vstart", "vstop");to the test caseand it does not work if I create the db schema objects inside a transaction, but it works if I create them outside of a transaction.
lvca commentedon Jun 9, 2023
It looks like that constraint was never applied in OrientDB, then ArcadeDB. So nevermind about the UPSERT. The point here is that the failing query is using a composite index with a partial key and fails. Checking on it.
lvca commentedon Jun 9, 2023
Found the issue. The LSMTreeCursor, at build time, checks if the cursor is valid, but when it finds out that the 1st entry has been updated, it didn't continue with the next element. Fixed the issue locally, waiting to check for any regressions.
fix: fixed issue with index cursor and deleted/updated items
fix: fixed latest test case for issue #1113
vic0824 commentedon Jun 10, 2023
It works, thanks!
fix: fixed issue with index cursor and deleted/updated items
fix: fixed latest test case for issue ArcadeData#1113