Skip to content

[seed 517d42] Evaluation change; do not merge - #32

Open
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/517d42
Open

[seed 517d42] Evaluation change; do not merge#32
sshiv012 wants to merge 1 commit into
coderabbit-eval/basefrom
seed/517d42

Conversation

@sshiv012

@sshiv012 sshiv012 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Evaluation PR. Do not merge.

  • Remove synchronization around Iceberg catalog creation.
  • Allow concurrent cache access while creating a catalog.
  • Add the catalog to the cache, then retrieve it directly.
Author Lines added Lines removed
Not identified 7 2

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

getInstance no longer synchronizes cache access during Iceberg catalog creation. It now checks, creates, inserts, and retrieves catalog instances through separate cache operations.

Changes

Iceberg catalog cache

Layer / File(s) Summary
Unsynchronized catalog lookup and creation
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala
getInstance replaces synchronized getOrElseUpdate access with separate cache operations. Catalog creation no longer holds the object monitor. Concurrent cache misses can create separate catalogs for the same key.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: mengw15

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title labels the pull request as an evaluation change but does not describe the Iceberg catalog concurrency change. Replace the evaluation label with a concise description of the cache access and catalog creation concurrency change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch seed/517d42

Comment @coderabbitai help to get the list of available commands.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sshiv012

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 133da7b and b7d2a74.

📒 Files selected for processing (1)
  • common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala

Comment on lines +77 to +80
if (!catalogs.contains(key)) {
catalogs.put(key, createCatalog(name))
}
catalogs(key)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 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.

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.

1 participant