Repository navigation
Description
ArcadeDB Version:
upgrading from 23.5.1 to 23.6.1
OS and JDK Version:
$ java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc37) (build 17.0.7+7)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc37) (build 17.0.7+7, mixed mode, sharing)
$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="37 (Server Edition)"
Expected behavior
Upgrading from 23.5.1 to 23.6.1 should not have regressed Database#drop
screenshot of "slow" 23.6.1 profile showing 904 ms spent in EmbeddedDatabase#drop, w/ 872 ms coming from PageManager#close:

screenshot of "fast" 23.5.1 profile showing 36 ms spent in EmbeddedDatabase#drop:

The only difference between these profiler snapshots is the arcadedb upgrade
Actual behavior
Between upgrading from 23.5.1 to 23.6.1 a single test I have went from executing in ~6 seconds to >24 seconds
faster 23.5.1 test logs show:
5300 [main] [INFO] io.vos.service.graph.database.arcadedb.ArcadeUpsertNodeMutationTest - dropping db:[/tmp/arcadedb-databases/ArcadeUpsertNodeMutationTest-285f7f28-ca71-4f1b-9bf0-ca3b2161cc54]
| | | | | | | duration: 30 ms
| | | | | | | status: [OK] SUCCESSFUL
| | | | | '-- VertexTests finished after 93 ms.
| | | | '-- UpsertNodeMutationTests finished after 5337 ms.
slow 23.6.1 test logs show:
23265 [main] [INFO] io.vos.service.graph.database.arcadedb.ArcadeUpsertNodeMutationTest - dropping db:[/tmp/arcadedb-databases/ArcadeUpsertNodeMutationTest-fad9eea7-ed02-4ae0-9b1f-690f1fc203d0]
| | | | | | | duration: 1031 ms
| | | | | | | status: [OK] SUCCESSFUL
| | | | | '-- VertexTests finished after 3094 ms.
| | | | '-- UpsertNodeMutationTests finished after 24298 ms.
From the above "dropping db" log line, there is a slow down from ~30ms to ~1s per test, where "teardown" is effectively:
logger.info("dropping db:[{}]", dbName);
if (db != null) {
db.drop();
db = null;
}
I have been unable to reproduce this regression on the arcadedb test suites, trying to use com.arcadedb.DocumentTest as a proxy for teardown behavior, but it's 100% repeatable in my test setup.
Profiling the running tests with VisualVM shows the latency regression is 100% located in com.arcadedb.engine.PageManager#close
Steps to reproduce
I'm still working on a simply JUnit test that reproduces the issue, but I"m filing a bug here in case it's obvious where the regression might have come from in the release window.
Activity
[-]EmbeddedDatabase#drop regressed up to 30x latency between 23.5.1 and 23.6.1[/-][+]EmbeddedDatabase#drop 30x latency regression between 23.5.1 and 23.6.1[/+]erickj commentedon Sep 9, 2023
attaching visual vm profile snapshots, although I don't see much more info here
visual-vm-snapshots.zip
erickj commentedon Sep 9, 2023
I've created a simple unit test which reproduces this issue & added it to the gist:
https://gist.github.com/erickj/cae0a52053b4c8f054b222ca3fbad3fc#file-slowteardowntest-java
There are 2 tests that run, as it seems that there are 2 cases to consider here:
See log output for the simple test attached to the gist:
lvca commentedon Sep 10, 2023
@erickj Thanks for the hyper-detailed report. I'm checking on it.
lvca commentedon Sep 10, 2023
Okay, thanks to your report I found it quickly. This is to blame: f230646#diff-c850d6d81d642f63e8a1d34280a05e4739d0850d885ad612cb16daf827bbad0dL86. Working towards a more efficient way to manage the poll from the queue.
fix: fixed larger closing time of the database introduced after 23.5.1
lvca commentedon Sep 10, 2023
@erickj please let me know if this fix resolves the issue. The test suite now finishes much faster than before on my PC.
erickj commentedon Sep 10, 2023
thanks for picking this up so quickly @lvca
overall, the speed issues look solved (mostly).... but now there is a concerning severe error appearing in the logs in ~40% of test runs, which when it occurs now takes 2s to execute db#drop:
erickj commentedon Sep 10, 2023
I actually noticed the same error when running the arcadedb
mvn packageto build the jars.wdyt? is this actually innocuous and can be ignored? or is this something more serious that could lead to database corruption on
PageManager#flushPage?erickj commentedon Sep 10, 2023
@lvca what do you think about this instead?
erickj@4a6a00b
gives results:
4 remaining items
erickj commentedon Sep 10, 2023
Great thanks @lvca !
Where can I find the new implementation w/ the "GOODBYE" message for the queue (sounds much more clean, btw)? I don't see it committed to
mainfix: 2nd attempt to fix the issue with closing of the flush thread in…
lvca commentedon Sep 10, 2023
@erickj it wasn't pushed, no it is.
lvca commentedon Sep 10, 2023
Instead of using a message, I used an empty list for that. When the page list is empty, then it means te threads must shutdown. In all other cases the list must be never empty.
erickj commentedon Sep 10, 2023
looks great! thanks
chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.18.0…
chore(deps): bump actions/setup-python from 6.0.0 to 6.1.0 [skip ci]
chore(deps-dev): bump testcontainers from 11.11.0 to 11.12.0 in /e2e-…
chore(deps-dev): bump testcontainers from 11.11.0 to 11.12.0 in /e2e-…
fix: fixed larger closing time of the database introduced after 23.5.1
fix: 2nd attempt to fix the issue with closing of the flush thread in…
chore(deps): bump org.codehaus.mojo:versions-maven-plugin from 2.18.0…
chore(deps): bump actions/setup-python from 6.0.0 to 6.1.0 [skip ci]
chore(deps-dev): bump testcontainers from 11.11.0 to 11.12.0 in /e2e-…
chore(deps-dev): bump testcontainers from 11.11.0 to 11.12.0 in /e2e-…