[BUG] Stale table creates enter update validation instead of returning a version conflict
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 85/100
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:
- A normal create request that omits server-owned properties reaches
TableType.valueOf(null)inskipEligibilityCheckand throwsNullPointerException, rather than the expected version conflict. - 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, andopenhouse.tableLocation=/db/table/00001.metadata.json. - Build a
TableDtousing the existingcreateTableDto(Map.of())helper and set its version toValidatorConstants.INITIAL_TABLE_VERSION. - Assert that
updateEligibilityCheck(existing, creation)throwsCommitFailedException. On the affected revision it throwsNullPointerException. - Repeat with an existing
REPLICA_TABLEand incoming properties identifying a remotePRIMARY_TABLE. A non-initial replication update remains permitted, but changing its version toINITIAL_TABLE_VERSIONshould 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linkedin/openhouse
-
[BUG] Retention with backup fails for MONTH and YEAR time-partitioned tablesPossibly taken @0z5a claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 28/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 2 days
All issues in linkedin/openhouse
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
molgenis/molgenis-emx2#7059 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
quarkiverse/quarkus-flow#1169 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eclipse-4diac/4diac-ide#3211 ·
Maintainers usually reply within 1 day
-
needs-umair step-4
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Umairishuman/BuildScan3D#24 ·
-
👀 example 📱 iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
hyochan/react-native-nitro-sound#871 ·
Maintainers usually reply within 2 days