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

Open
#784 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@menarguez is already working on this.

Since Oct 1, 2026.

  • #785 by @menarguez — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
databases

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
Java
Stars
406
Forks
86
Avg merge
4d 6h
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linkedin/openhouse

All issues in linkedin/openhouse

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.