Skip to content

[iceberg-rest-fixture] fix sqlite error under high concurrent load #13367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 1, 2025

Conversation

kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Jun 22, 2025

Closes #13366

Use file-based sqlite db (i.e. jdbc:sqlite:/tmp/iceberg_catalog.db) instead of in-memory sqlite db (jdbc:sqlite:memory:)
File-based sqlite db allows for concurrent access with multiple jdbc connections. By contrast, in-memory sqlite db creates a new db per jdbc connection. Even with shared caching enabled (jdbc:sqlite:file::memory:?cache=shared), in-memory sqlite db can perform concurrent reads but concurrent writes will have race conditions and fail a subset of the requests.

Test

Tested locally by explicitly overriding the env parameters in pyiceberg's integration test setup

      - CATALOG_URI=jdbc:sqlite:/tmp/iceberg_catalog.db

and then running the "Reproduce" code in #13366

@kevinjqliu kevinjqliu requested a review from Fokko June 22, 2025 21:12
@kevinjqliu kevinjqliu force-pushed the kevinjqliu/fix-iceberg-rest-fixture branch from c979fec to dc9ad30 Compare June 22, 2025 21:58
@github-actions github-actions bot removed the OPENAPI label Jun 24, 2025
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kevinjqliu , this change makes sense to me.

Next to the concurrency issues, I think it also makes sense to keep the data around when restarting a container.

@Fokko Fokko merged commit 45e3ae3 into apache:main Jul 1, 2025
2 checks passed
@kevinjqliu kevinjqliu deleted the kevinjqliu/fix-iceberg-rest-fixture branch July 1, 2025 14:40
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.

iceberg-rest-fixture errors with SQLiteException under high concurrent load
2 participants