Skip to content

Back datastore HASH labels with an IndexedLabel on the V3 path - #459

Merged
em3s merged 1 commit into
mainfrom
fix/datastore-hash-indexed-backed
Jul 24, 2026
Merged

em3s merged 1 commit into
mainfrom
fix/datastore-hash-indexed-backed

Conversation

@em3s

@em3s em3s commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A HASH label on datastore storage can't be mutated on the V3 path. Every edge mutation fails with This Label (<db>.<table>, class ...DatastoreHashLabel) is not indexed or not supported for edge mutation.

V2BackedEngine.getTableBinding only accepts labels in the HBaseIndexedLabel family. HBase HASH labels clear that gate through HBaseHashOnlyIndexedLabel (#296), but the datastore branch of LabelEntity.materialize produced DatastoreHashLabel, which extends HBaseHashLabel directly and sits outside that family. The label materializes and passes DDL, then fails only at mutation time with a 400. This reproduces identically on v0.4.6 and main — the datastore HASH path was never wired through the V3 table binding.

The fix adds DatastoreHashOnlyIndexedLabel, the datastore mirror of HBaseHashOnlyIndexedLabel: an HBaseIndexedLabel with no indices whose scan/cache throw. With no indices the indexed mutation path writes only the base hash rows, so the on-disk format stays identical to a plain hash label and existing datastore HASH tables keep working with no data migration.

A backport to 0.4.x follows in a separate PR.

Changes

  • Add DatastoreHashOnlyIndexedLabel and route HASH + DatastoreStorage to it in LabelEntity.materialize
  • Remove the now-unused DatastoreHashLabel
  • Add DatastoreHashLabelSpec covering materialization type, getTableBinding, edge mutation, and get

How to Test

./gradlew :engine:test --tests "com.kakao.actionbase.v2.engine.v3.DatastoreHashLabelSpec"

Full :engine:test passes locally.

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Opus 4.8)

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 24, 2026
@em3s em3s mentioned this pull request Jul 24, 2026
1 task done
A HASH label on datastore storage materialized to DatastoreHashLabel, which
extends HBaseHashLabel directly and therefore sits outside the HBaseIndexedLabel
family that V2BackedEngine.getTableBinding requires. Every edge mutation on such
a table failed on the V3 path with "not indexed or not supported for edge
mutation". HBase HASH labels already avoid this via HBaseHashOnlyIndexedLabel
(PR #296); datastore was never given the equivalent wrapper.

Add DatastoreHashOnlyIndexedLabel, the datastore mirror of
HBaseHashOnlyIndexedLabel: an HBaseIndexedLabel with no indices whose scan/cache
throw UnsupportedOperationException. With no indices the indexed mutation path
writes only the base hash rows, so the on-disk format is identical to a plain
hash label and existing tables need no data migration. Route the
HASH + DatastoreStorage branch to it and drop the now-unused DatastoreHashLabel.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@em3s
em3s force-pushed the fix/datastore-hash-indexed-backed branch from 786842d to e34786f Compare July 24, 2026 03:27
@em3s

em3s commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Optimistic

@em3s
em3s merged commit edb93be into main Jul 24, 2026
2 checks passed
@em3s
em3s deleted the fix/datastore-hash-indexed-backed branch July 24, 2026 04:58
em3s added a commit that referenced this pull request Jul 24, 2026
em3s added a commit that referenced this pull request Jul 24, 2026
* Back datastore HASH labels with an IndexedLabel on the V3 path (#459)

(cherry picked from commit edb93be)

* Clarify getTableBinding error message to cover the query path (#461)

(cherry picked from commit bf7f96d)
@em3s em3s self-assigned this Jul 24, 2026
em3s added a commit that referenced this pull request Jul 24, 2026
Mutate/query now go through MutationService/QueryService — the path the
original incident hit — instead of calling getTableBinding directly and
using the V2 graph.mutate. Add a legacy-data case: rows written through
an HBaseHashLabel writer (the removed DatastoreHashLabel shape) stay
readable through the V3 API, and V3 writes coexist on the same table,
backing the no-migration claim of #459.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant