leaves12138 commented on code in PR #6977:
URL: https://github.com/apache/paimon/pull/6977#discussion_r2671065200
##########
paimon-python/pypaimon/write/file_store_commit.py:
##########
@@ -317,33 +260,43 @@ 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."
- )
+ logger.warning(f"Atomic commit failed for snapshot
#{new_snapshot_id} failed")
self._cleanup_preparation_failure(new_manifest_file,
delta_manifest_list,
base_manifest_list)
- return RetryResult(latest_snapshot, None)
- except Exception as e:
+ 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
- logger.warning(
- f"Successfully commit snapshot {new_snapshot_id} to table
{self.table.identifier} "
- f"for snapshot-{new_snapshot_id} by user {self.commit_user} "
- + f"with identifier {commit_identifier} and kind {commit_kind}."
- )
- return SuccessResult()
+ def _cleanup_preparation_failure(self, manifest_file: Optional[str],
Review Comment:
Indeed
--
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]