[seed 517d42] Evaluation change; do not merge - #32
Conversation
📝 WalkthroughWalkthrough
ChangesIceberg catalog cache
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala`:
- Around line 77-80: Make catalog initialization in IcebergCatalogInstance’s
lookup path atomic per key: synchronize the complete contains/create/put/get
sequence using the same lock as replaceInstance, or replace the cache with a
thread-safe compute-if-absent mechanism. Ensure concurrent misses return the
same catalog and create only one instance, and add a concurrency test covering
simultaneous initialization.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 70ec5e68-9538-4348-9d04-8939d57ef016
📒 Files selected for processing (1)
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala
| if (!catalogs.contains(key)) { | ||
| catalogs.put(key, createCatalog(name)) | ||
| } | ||
| catalogs(key) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy lift
Restore atomic catalog initialization.
contains, createCatalog, put, and get are not one atomic operation. Two concurrent IcebergDocument instances can miss the same key, create separate catalogs, and overwrite each other. Callers can receive different instances, and a discarded PostgreSQL catalog can retain its connection pool.
Use a thread-safe cache with atomic per-key initialization, or protect the complete lookup/create/insert sequence with the same lock used by replaceInstance. Add a concurrency test that proves one catalog is created for concurrent misses.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala`
around lines 77 - 80, Make catalog initialization in IcebergCatalogInstance’s
lookup path atomic per key: synchronize the complete contains/create/put/get
sequence using the same lock as replaceInstance, or replace the cache with a
thread-safe compute-if-absent mechanism. Ensure concurrent misses return the
same catalog and create only one instance, and add a concurrency test covering
simultaneous initialization.
Evaluation PR. Do not merge.