Repository navigation
NAKSHA-33: Batch PostgreSQL writes and automate partition maintenance - #692
Merged
Merged
Conversation
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…r numeric identifiers. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…search, and adding partman support. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…d collection and catalog number calculation. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…orage. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…abaseImpl Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
… postgres specific class (PgTx) Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…failure to NakshaError. Deprecated the exception as it is not JSON serializable. We have a NakshaException as carrier exception, when we want to transport exceptions, we should not serialize them, not even try to. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…latform threading support. The local primary IP is used as emergency fallback to appId and appName, so that when it is not initialized by an app, at least some value is available. This avoids plenty of issues when using Naksha class to get instances of storages, where these values are less of importance. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…NakshaFeature. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…thod from Id We now compare catalog id, collection id, then feature id to order writes, so that now everything uses the same algorithm. Remove dictionary support as it was never used and we do not support any more (we have JBON books as replacement, better designed, to be supported soon). Removed validate, it need to be done in the storage, it is not reliable here. We as well removed not used purge method (clients should use NakshaCollection). Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Replace IMemberEncoder and the model routing trie with a declarative builder, privately copied flat reference plans and incremental encoder traversal. Reuse content-checked per-MemberList snapshots without caching payloads or coercion types; preserve raw edits, book positions, prefix/root behavior, dictionary reset and deferred missing-slot errors. Migrate callback tests to actual reference emission, add cache invalidation/publication and JavaScript int32 input guards, and record passing JVM/PLV8/cron validation plus measured allocation reductions and mixed throughput. Reproduce the expanded Node float failures against the saved baseline rather than attributing them to this rewrite. Save this user-approved checkpoint before quieter unattended CPU/throughput experiments. Keep beta.55, preserve the user's delegation-hint commit, and perform no deployment or upgrade work. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Check cached member-reference layouts during the required extraction pass instead of rereading all member proxies afterward. Preserve current coercion, readonly processor contracts, actual book positions, complete entry/count checks and cold-layout validation. Use checked overlap-safe byte-array copies for encoder compaction and fresh tuple assembly, accounting for mapped-view offsets without changing Binary accessor contracts or JBON bytes. Add boundary, Unicode, offset-sentinel and cache-mutation coverage; verify a 40-case byte corpus against the saved checkpoint. Record four quiet interleaved comparisons showing about 31% less small-tuple encoding CPU and 61-62% less large-tuple CPU, with consistent large INSERT/UPDATE gains and disclosed mixed cases. Verified forced metadata/JVM/JS compilation, 1852 ordinary JVM cases, 85 isolated PostgreSQL cases, focused JVM/Node tests and real cron workers. Keep beta.55 and leave the next idea for discussion. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Compile privately copied member names, types, paths and native reference plans once per PgCollection descriptor. Fill independently owned values arrays through fixed logical slots, and share immutable name lookups without per-feature index-array or map construction. Route storage encoding and PostgreSQL row reconstruction through explicit member/book/column mappings. Preserve split tuple numbers, ordinal conversion, null slots, tombstone identity, processor values and undeclared content. Copy array-backed books for batch/history metadata updates and invalidate cached successor numbers on nextVersion changes; retain content checks for mutable raw declarations and leave local/global dictionaries unchanged. Add IBook ownership, lookup, hash-collision, snapshot, byte-parity, action and row-mapping coverage. Resolve independent-review findings for required member types and optional/virtual Origin. Verify forced metadata/JVM/JS compilation, 1863 ordinary JVM cases, 85 isolated PostgreSQL cases, focused JVM/Node tests and actual cron workers. Record four serial comparisons: small-tuple encoding CPU falls 44-46% and allocation falls by 2352 bytes per feature; large encoding improves only 1-2.5%. Whole-request CPU/allocation improves across measured cases, with noisy throughput and existing JS/PLV8 coverage limits disclosed. Keep beta.55 and perform no migration, deployment or server-setting change. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Advance the Gradle project version, generated NakshaVersion.CURRENT and OpenAPI version to 3.0.0-beta.56 for the user to publish manually. Include the saved tuple CPU and collection-layout optimization checkpoints in the branch handoff. Keep adminVersion at beta.55 and minimum compatible admin at beta.53 because this version-only handoff adds no SQL installation change. Generate versions explicitly before assembly; verify assemble without build cache, 10 focused JVM version/layout tests and the assembled model JAR version resource. Defer further optimizations and perform no artifact publication, release tag, deployment or database upgrade work. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
…AKSHA_TEST_PSQL_DB_URL Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Make cleanAndTest compile the project and run fresh JVM and Node checks through the pinned Gradle wrapper. Require a disposable shared PostgreSQL URL and keep fixtures on that database without dropping it or honoring local URL files during aggregate runs. Quarantine only Node methods that failed in the unfiltered baseline. Run GitHub PR checks with the PostgreSQL 18.6-rc1 service and publish JVM and Node test reports. Align managed test image pins and refresh the README with Naksha branding, a Mercator map logo, and reproducible test setup and environment guidance. The local CI-equivalent run on 18.6-rc1 passed 1,856 JVM and 349 Node tests and produced JaCoCo coverage. A fresh-container TCP login verified the final disposable password. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Set the project, generated library version, and OpenAPI version to 3.0.0-beta.57. Leave PostgreSQL admin compatibility unchanged. Remove the NAKSHA-33 working files from the checkout after archiving them in the sibling AI workspace. Keep contributor-facing test setup and isolated-suite recipes in docs/testing.md. Update the branch-local AI guidance to prefer a sibling .ai ticket directory and fall back to a checkout-local ai ticket directory. Verified version generation, assembly without the build cache, and the archive inventory, links, and SQL includes. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
gunplar
previously approved these changes
Nov 25, 2026
Use the configured PostgreSQL database as a control connection and allocate a fresh numbered database per test invocation. Use a persistent counter, pad names to at least three digits, skip occupied names, and retain every run database for inspection after either success or failure. Direct test tasks keep their existing behavior. Standardize the shared local test container on host port 15432 in the documentation and Gradle setup hint. Two consecutive CI-profile runs on the same container each passed 1,856 JVM and 349 Node tests. Verified database retention, collision handling, and padding beyond 999. Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
hirenkp2000
requested changes
Nov 26, 2026
hirenkp2000
left a comment
Member
There was a problem hiding this comment.
Reviewed following submodules:
- here-naksha-app-service
- here-naksha-lib-handlers
- here-naksha-lib-hub
- here-naksha-lib-view
- here-naksha-storage-http
| createHandler(nakshaClient, "CollectionModification/setup/historySpace/create_event_handler.json"); | ||
| createSpace(nakshaClient, "CollectionModification/setup/historySpace/create_space.json"); | ||
|
|
||
| // History mode is a creation-time setting, so the OFF case uses its own collection and activity view. |
Member
There was a problem hiding this comment.
Good-to-have comment. Not mandatory to block MR.
From code readability perspective, we can create JSON files for spaces and handlers and refer them here instead of adding 20+ lines of code (similar to how existing spaces/handlers are setup in setup() function)
Member
Author
There was a problem hiding this comment.
Thanks for the suggestion. I left the setup inline in this PR to keep the follow-up focused on the behavioral fixes. Moving the space and handler definitions into JSON fixtures would be a useful readability cleanup.
# Conflicts: # here-naksha-lib-model/src/commonMain/kotlin/naksha/model/Tuple.kt
Signed-off-by: phmai <phuc.mai@here.com>
Code Coverage
|
Marcin-Here
requested changes
Nov 26, 2026
hirenkp2000
previously approved these changes
Nov 26, 2026
Code Coverage
|
Marcin-Here
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg_cron, retaining synchronous partition coverage on the write path../gradlew cleanAndTest, update the Naksha README and logo, and bump the project to3.0.0-beta.57.Verification
v18.6-rc1: 1,856 JVM and 349 Node tests passed with no failures; JaCoCo coverage generated. Known failing Node cases are explicitly quarantined../gradlew assemble --no-build-cachepassed after the beta.57 version bump. Hosted PR verification remains pending.Rollout
Merge this PR into
v3before merging the downstream GitLab CI template change. Validate an untaggedv3build before publishing the release.NAKSHA-33