HyeonUk Kang created ZEPPELIN-6269: -------------------------------------- Summary: Handle remove failures in NotebookRepoSync to prevent data inconsistency Key: ZEPPELIN-6269 URL: https://issues.apache.org/jira/browse/ZEPPELIN-6269 Project: Zeppelin Issue Type: Improvement Components: zeppelin-zengine Affects Versions: 0.12.0 Reporter: HyeonUk Kang Assignee: HyeonUk Kang Fix For: 0.12.0
Currently, the `NotebookRepoSync.remove()` method has a `TODO` comment indicating that it does not properly handle failures when removing a note from secondary storage. If an `IOException` occurs while trying to remove a note from one of the repositories, the `for` loop would terminate immediately. This leaves the note in an inconsistent state where it is deleted from some repositories but not from others, leading to data inconsistency. The updated logic ensures that a failure on one repository does not halt the entire process. 1. The method will now attempt to remove the note from all configured repositories, regardless of any intermediate failures. 2. All failures are logged, and the corresponding repositories are collected in a list. 3. Only after trying to remove the note from every single repository will the method check the list of failures. 4. If any removal attempts failed, a single `IOException` is thrown, consolidating the error details from all failed repositories. -- This message was sent by Atlassian Jira (v8.20.10#820010)