[BUG] Stale table creates enter update validation instead of returning a version conflict

Aperta
#784 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@menarguez ci sta già lavorando.

Dal 1/10/2026.

  • #785 di @menarguez — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
databases

Direzione di ricerca

Start with updateEligibilityCheck and the existing OpenHouseInternalRepositoryImplTest in the :services:tables module. Run the named Gradle test, then add the two deterministic cases described for existing PRIMARY_TABLE and REPLICA_TABLE records. Done means INITIAL_TABLE_VERSION requests raise CommitFailedException before update-only properties are inspected, while non-initial replication updates remain permitted.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Willingness to contribute

Yes. I can contribute a fix for this bug independently.

OpenHouse version

Reproduced on main at 372efaf4440f721797f339811d5246f5c1feed14.

System information
  • Linux
  • OpenJDK 17
  • Local Tables service repository tests; no external services required
Describe the problem

A create request carrying ValidatorConstants.INITIAL_TABLE_VERSION can reach the repository after another writer has created the same table. The existing-table path calls updateEligibilityCheck, which inspects update/replication properties before validating the requested base version.

This produces inconsistent outcomes:

  1. A normal create request that omits server-owned properties reaches TableType.valueOf(null) in skipEligibilityCheck and throws NullPointerException, rather than the expected version conflict.
  2. Where the existing replica/replication handling skips update eligibility checks, the same stale create can pass this validation without a version conflict.

Expected behavior: once the table exists, reject an INITIAL_TABLE_VERSION request with CommitFailedException before inspecting update-only properties. Preserve the existing handling of non-initial replication updates.

Code to reproduce bug

Add deterministic tests to OpenHouseInternalRepositoryImplTest:

  • Mock an existing table with openhouse.clusterId=local, openhouse.tableType=PRIMARY_TABLE, and openhouse.tableLocation=/db/table/00001.metadata.json.
  • Build a TableDto using the existing createTableDto(Map.of()) helper and set its version to ValidatorConstants.INITIAL_TABLE_VERSION.
  • Assert that updateEligibilityCheck(existing, creation) throws CommitFailedException. On the affected revision it throws NullPointerException.
  • Repeat with an existing REPLICA_TABLE and incoming properties identifying a remote PRIMARY_TABLE. A non-initial replication update remains permitted, but changing its version to INITIAL_TABLE_VERSION should conflict. Currently the stale create passes eligibility validation.

Run:

./gradlew :services:tables:test \
  --tests com.linkedin.openhouse.tables.repository.impl.OpenHouseInternalRepositoryImplTest
Stacktrace, metrics and logs

The nine existing tests pass on the unmodified revision. With the two regressions added, the result is:

11 tests completed, 2 failed
concurrentCreationConflictsBeforeInspectingMissingReservedProperties:
  Expected CommitFailedException; caused by NullPointerException
concurrentCreationConflictsForReplicaWhileReplicationUpdatesRemainAllowed:
  Expected CommitFailedException, but nothing was thrown
Affected component
  • Table Service: :services:tables
Lingua principale
Java
Stelle
406
Fork
86
Merge medio
4g 6h
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linkedin/openhouse

Tutte le issue di linkedin/openhouse

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.