Repository navigation
fix(native): BACKUP DATABASE keeps Backup.backupDatabase() in the native image - #12556
Conversation
…ive image #12412 moved the reflective getMethod("backupDatabase") into the lambda run by OutsideCallerTransaction.call. native-image cannot fold a lookup whose Class is a captured lambda field, so the method was dropped and the statement failed with NoSuchMethodException in the native E2E tests. The Method is now resolved before the lambda, and Backup's constructor and backupDatabase() are registered in the reachability metadata.
|
This pull request is merged. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Triage: LGTM. The fix is small and targeted.
Caveats:
I rated this as major. |
…els; docs: open a database with an older wheel (#416) * Native image: keep Backup.backupDatabase() for BACKUP DATABASE, and test the statement on both wheels Upstream ArcadeData/arcadedb#12556 (fcc52e0f) registered com.arcadedb.integration.backup.Backup in its own reachability metadata: the (Database, String) constructor and backupDatabase(). BACKUP DATABASE finds the class by name; since #12412 (after the 26.11.1 release) it looks the method up inside a lambda, which native-image cannot fold, so the nightly native build lost the method (NoSuchMethodException). This file had no entry. The entry is copied as upstream has it (same type, same two methods, no flags), in this file's one-space indent and alphabetical place. At the pinned engine 26.11.1 the lookup is not yet in a lambda, so the entry is not needed there; it is needed from the first engine release that contains #12412, and it does no harm before. The only BACKUP DATABASE test is JVM-only because it sets the engine's global backup directory through JPype. The new test starts a server (the default backup directory is <root path>/backups, so nothing global is set), runs BACKUP DATABASE, finds the archive, unzips it and opens it, so it runs on the native wheel too. Not run here: no tests could be run on the authoring host. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * docs: say that a 26.11.x database must not be opened with an older wheel 26.11.1 wheels write float and double arrays in the fixed-width form (binary types 36 and 37, arcadedb.serializer.fixedWidthFloatArrays, on by default). Read from upstream: the setting's default and text at 26.11.1, ArcadeData/arcadedb#12234 (26.10.x and 26.9.1 open such a database without an error, read the arrays as null, and the next UPDATE drops them) and #12239 (fd18fce4, main only: the dictionary is labelled format version 2 while the setting is on, at the first read-write open, and builds from 26.8.1 to 26.11.x refuse it; setting it to false before that open keeps a rollback possible). The page has no upgrade or downgrade section, so a new one goes on the installation page, with the safe rule and the system property route that the durability page already documents. No static release-notes file exists: the release notes are built from pull request titles (scripts/release_notes.py). Not run: the Antora build (the Docs workflow does it). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
What
The nightly native build fails in the E2E tests (run 44438961124):
BACKUP DATABASEthrowsNoSuchMethodException: com.arcadedb.integration.backup.Backup.backupDatabase(). It failsRemoteDatabaseJavaApiIT.backupDatabaseandJdbcQueriesIT.backupDatabaseon both amd64 and arm64.Why
#12412 moved
clazz.getMethod("backupDatabase")into the lambda passed toOutsideCallerTransaction.call(...). native-image keeps a reflectively called method only when it can resolve the class and method name while it builds the image. Inside the lambda,clazzarrives as a captured field, so the build can't resolve it and drops the method. The setter lookups in theswitcharms are not affected: they run in the same method asClass.forName. No otherClass.forName("com.arcadedb.integration...")caller looks up a method inside a lambda.Fix
BackupDatabaseStatement: look up theMethodbefore the lambda, and only callinvokeinside it.reachability-metadata.json: registerBackup's(Database, String)constructor andbackupDatabase(), so the image keeps them even if the lookup moves again.Verification
BackupDatabaseTest,BackupSettingsTestandBackupDatabaseStatementTestParserTestpass (19 tests). They run on the JVM, where this failure cannot happen, so they only show nothing regressed.Summary by CodeRabbit