Skip to content

test(transaction): add round-trip tests for transaction APIs against MemoryCatalog - #3133

Open
dhruvarya-db wants to merge 2 commits into
apache:mainfrom
dhruvarya-db:revive-1322-transaction-round-trips
Open

test(transaction): add round-trip tests for transaction APIs against MemoryCatalog#3133
dhruvarya-db wants to merge 2 commits into
apache:mainfrom
dhruvarya-db:revive-1322-transaction-round-trips

Conversation

@dhruvarya-db

Copy link
Copy Markdown
Contributor

Reviving #2392, which added these tests but was auto-closed as stale.

Most of the per-action tests in transaction/mod.rs only check the ActionCommit an action produces. Fast-append is already exercised end-to-end through a catalog (see test_transaction_snapshot_summary and test_fast_append_with_row_lineage), but the property, location, and multi-action paths don't have that kind of round-trip coverage yet. This adds it.

Which issue does this PR close?

Part of #1322.

What changes are included in this PR?

A new test_commit_against_memory_catalog module, built on the existing make_v3_minimal_table_in_catalog helper, covering:

  • setting properties and reading them back after commit
  • updating the table location
  • chaining a property update and a location update, and checking it lands as a single metadata-log entry rather than two separate commits
  • a chained transaction whose last action is invalid, checking the whole commit is rejected and the catalog is left untouched

The last two also fold in @andybradshaw's review feedback from #2392 (asserting the chained update is a single commit via the metadata-log length, and adding the failing-transaction case).

Are these changes tested?

They are the tests. Ran them locally with cargo test -p iceberg; fmt and clippy are clean too.

…MemoryCatalog

Add end-to-end tests that commit transactions against an in-process
MemoryCatalog and assert the persisted metadata, covering property
updates, location updates, atomic multi-action commits, and rollback
when one action in a chained transaction fails.
Drop the module doc and what-style comments to match the terser
comment density of the surrounding test modules, keeping only the
non-obvious why notes.

@blackmwk blackmwk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, @dhruvarya-db If you want to add integration tests of transactions against catalogs, you should refer to crates/catalog/loader/tests as example, you could write it against all kinds of catalog. Memory catalog should be used only for ut.

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.

3 participants