JingsongLi commented on code in PR #1109:
URL: https://github.com/apache/paimon-rust/pull/1109#discussion_r4248894429
##########
crates/paimon/src/table/mod.rs:
##########
@@ -903,12 +903,12 @@ impl Table {
// Catalog branches may have no schema directory in the data store.
// Load their schema, identity and FileIO through the same catalog.
let identifier = env.identifier().with_branch(&branch)?;
- let mut table = env.get_table(&identifier).await?;
- if table.location() != self.location()
- || table
- .rest_env
- .as_ref()
- .is_none_or(|branch_env| branch_env.uuid() != env.uuid())
+ let (current, mut table) = tokio::try_join!(
+ env.current_table_identity_checked(),
+ env.get_table(&identifier)
+ )?;
Review Comment:
[P2] Recheck the source identity after loading the target
These concurrent GETs can observe different catalog generations. For an
external table re-registered at the same path, the source request can return
the loaded v1 UUID, then the target request return v2 after re-registration.
Both location checks pass, and the returned Table/RESTEnv silently adopt the
replacement UUID/schema. This even reproduces with a loaded main handle calling
copy_with_branch("main"): using the real HTTP mock's
set_table_uuid_after_calls(..., "replacement-v2", 1), all 16 attempts return v2
from a handle loaded as v1. The baseline switch never adopts v2 in the same
probe. Stable external paths are a supported catalog registration model, so
matching paths do not establish a shared generation. Please bracket the target
resolution with another source UUID/path check, or provide an equivalent
identity association; a temporary post-target check fixes the probe and
preserves the distinct-branch behavior. Add a regression for re-registration
during the switch, in addi
tion to the already-stale-source test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]