JingsongLi commented on code in PR #6977:
URL: https://github.com/apache/paimon/pull/6977#discussion_r2671342499
##########
paimon-python/pypaimon/write/file_store_commit.py:
##########
@@ -317,33 +258,20 @@ def _try_commit_once(self, retry_result:
Optional[RetryResult], commit_kind: str
with self.snapshot_commit:
success = self.snapshot_commit.commit(snapshot_data,
self.table.current_branch(), statistics)
if not success:
- # Commit failed, clean up temporary files and retry
- commit_time_sec = (int(time.time() * 1000) -
start_time_ms) / 1000
- logger.warning(
- f"Atomic commit failed for snapshot #{new_snapshot_id}
"
- f"by user {self.commit_user} "
- f"with identifier {commit_identifier} and kind
{commit_kind} after {commit_time_sec}s. "
- f"Clean up and try again."
- )
- self._cleanup_preparation_failure(new_manifest_file,
delta_manifest_list,
- base_manifest_list)
- return RetryResult(latest_snapshot, None)
- except Exception as e:
+ logger.warning(f"Atomic commit failed for snapshot
#{new_snapshot_id} failed")
+ self._cleanup_preparation_failure(delta_manifest_list,
base_manifest_list)
+ return success
+ except Exception:
# Commit exception, not sure about the situation and should not
clean up the files
logger.warning("Retry commit for exception")
- return RetryResult(latest_snapshot, e)
+ return False
Review Comment:
Do not try catch commit, just fast fail.
--
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]