Skip to content

Immediate fixes after versioning bump - #621

Open
kkin-here wants to merge 138 commits into
v3from
lib_data_members_fix1_jvmtests
Open

kkin-here wants to merge 138 commits into
v3from
lib_data_members_fix1_jvmtests

Conversation

@kkin-here

Copy link
Copy Markdown

No description provided.

xeus2001 and others added 30 commits May 13, 2026 08:04
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
…implementation as far as possible.

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>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Root cause #1: Guid.ALL_PARTS was still 13 (expecting old uid field)
- Guid.kt — removed UID constant, changed ALL_PARTS from 13 to 12. The
Guid.fromString() was rejecting valid GUID strings because it expected
13 colon-separated parts (the old format with uid) but the new format
only has 12. This caused XyzNs.guid to silently return null, breaking 23
tests.
Root cause #2: next_tn/prev_tn/base_tn were B64 (8 bytes = txn only),
not unique per feature
- All features in the same transaction share the same txn value, so B64
next_tn was identical for all features written in one batch — making
history queries by next_tn return all features from that transaction
instead of only the intended ones.
- Fixed by changing next_tn/prev_tn/base_tn to B128 (16 bytes =
featureNumber + txn), which is unique per feature.
Files changed:
- Guid.kt — removed UID = 12, changed ALL_PARTS to 12
- PgColumnRows.kt — reads/writes prev_tn/next_tn/base_tn with B128
instead of B64
- PgWriterUpdate.kt — history next_tn set to new_row.tn (full B128)
- PgWriterUpsert.kt — history next_tn set to naksha_tn_128(...) with
action bits; prev_tn set to full head_row.tn; reads prev_tn via getB128
- PgWriterDelete.kt — tombstone next_tn set to naksha_tn_128(...);
prev_tn set to full head_row.tn; history next_tn set to tombstone.tn
- PgTable.kt — tombstone constraint changed from next_tn =
naksha_tn_64(tn) to next_tn = tn
- PgColumn.kt — KDocs updated for next_tn/prev_tn/base_tn
- ReadFeaturesByOtherTns.kt — test updated to serialize TupleNumbers as
B128 for next_tn queries

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Introduces `NakshaCollection.members` (typed user-defined columns) and
`NakshaCollection.indices` (replaces the legacy StringList opt-in list of
built-in indexes). At write time, the storage walks each feature using the
member's JsonPath (defaults to ["properties", name]), coerces the value to
the declared CustomMemberType, and stores it in a real Postgres column
namespaced with `$` (`$age`, `$price`, ...) to avoid collision with built-ins.
The value also remains in the encoded feature blob.

CustomMemberType (model-only, no SQL flavor):
  BOOLEAN, INT8/16/32/64, FLOAT32/64, STRING, BYTE_ARRAY,
  FLAT_MAP (object of primitives), TAGS (string-array expanded to flat map).

CustomIndexType: BTREE, SPATIAL, FLAT_MAP.

Schema mutability runs on UPSERT/UPDATE of an existing collection:
  - same name + same dataType -> no-op
  - same name + different dataType -> ILLEGAL_ARGUMENT (no type change)
  - new member -> ALTER TABLE ADD COLUMN on HEAD/HISTORY/DELETED/META roots
                  (nullable, no default - metadata-only on PG 11+)
  - removed member -> requires Write.force=true; ALTER TABLE DROP COLUMN
  - index identity = (name, type, on, include, unique); any diff -> drop+create

PgIndex.DEFAULT_INDICES is now always applied; the closed-enum opt-in via
`indices: StringList` is removed.

Naming:
  - Member/index names use the standard Naksha.verifyId rules (no new regex
    or MAX_LENGTH).
  - Physical PG column is `$<name>` so user names cannot collide with the
    built-in column namespace.
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.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: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
* Switch to next_version

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Refactor callers after prev_tn cleanup

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

---------

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Switch to using version, fn. Drop tn
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
…ement groups, it was anyway never used. (#588)

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
* Add binary encodings to structs in JBON1 documentation.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

* Integrate a v1 compatibility mode, bring v2 and v1 closer together.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

* Remove deletion table, ensure that queryHistory and queryDeleted are orthogonal.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

---------

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
* Drop geo/tags encoding from flags; collapse to TWKB and JBON_GZIP

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Move action from flags into the version's low two bits

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Drop the per-row flags column; encoding lives on the collection

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* drop misnamed Tuple.uid

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Replace Flags with a DataEncoding enum

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

---------

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Clean up tuples and next version stripping
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
xeus2001 and others added 27 commits June 26, 2026 10:14
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>
…feature.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
…se new Op membersQuery instead (#609)

Signed-off-by: phmai <phuc.mai@here.com>
…fetch of missing

Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
Signed-off-by: phmai <phuc.mai@here.com>
* move away from old guids read request model

Signed-off-by: phmai <phuc.mai@here.com>

* column names to predefined val in StandardIndices

Signed-off-by: phmai <phuc.mai@here.com>

* inject StandardIndices MANDATORY when creating collections

Signed-off-by: phmai <phuc.mai@here.com>

---------

Signed-off-by: phmai <phuc.mai@here.com>
* Fix query layer

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Fix psql write executor, delete dispatch, column typing and index DDL

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Handle spatial index

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Fix psql commit/read path, tag jsonb storage, and member round-trip

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Tags array from jsonb to an array, fixes to queries

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Second batch of psql fixes

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Third batch of psql fixes

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Address lib-model issues

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* Add a TODO note

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>

* fix some lib view tests

Signed-off-by: phmai <phuc.mai@here.com>

---------

Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: phmai <phuc.mai@here.com>
Co-authored-by: phmai <phuc.mai@here.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
* Merged JVM target code so we can change in properties, upgraded gradle to 9.6.1, upgraded libraries, upgraded to Kotlin 2.4.0, upgraded to JVM 25.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

* Fix JavaScript compilation, allow compiler to convert Long into BigInt and vice versa.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

* Fix relocated datetime classes.

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>

---------

Signed-off-by: Alexander Lowey-Weber <alexander.weber@here.com>
Signed-off-by: kkin-here <284318677+kkin-here@users.noreply.github.com>
@kkin-here
kkin-here force-pushed the lib_data_members_fix1_jvmtests branch from 2539b77 to 7e8770c Compare July 15, 2026 11:48
Base automatically changed from lib_data_members_fix1 to lib_data July 22, 2026 06:17
Base automatically changed from lib_data to v3 September 1, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants