Skip to content

[ZEPPELIN-6453] Handle secondary NotebookRepo remove failures consistently#5289

Merged
jongyoul merged 1 commit into
apache:masterfrom
move-hoon:ZEPPELIN-6453-remove-secondary-failure
Jul 12, 2026
Merged

[ZEPPELIN-6453] Handle secondary NotebookRepo remove failures consistently#5289
jongyoul merged 1 commit into
apache:masterfrom
move-hoon:ZEPPELIN-6453-remove-secondary-failure

Conversation

@move-hoon

Copy link
Copy Markdown
Contributor

What is this PR for?

In NotebookRepoSync, secondary storage failures were already handled for save() and move(), but remove() still used a generic for loop with a TODO comment for handling secondary remove failures.

This PR makes the remove() failure handling consistent with the existing save() and move() behavior:

  • Primary Storage (getRepo(0)): A failure during removal stops the operation and propagates the IOException.
  • Secondary Storage (getRepo(1)): A failure during removal is caught and explicitly logged, preventing silent inconsistencies without interrupting the overall operation.

To achieve this, the for loop in remove(String noteId, String notePath, AuthenticationInfo subject) was replaced with explicit getRepo(0) and getRepo(1) calls, and the outstanding TODO was removed.

What type of PR is it?

Improvement

What is the Jira issue?

How should this be tested?

Tested via NotebookRepoSyncTest using Mockito to explicitly verify the primary vs. secondary failure behaviors:

  • testRemoveSucceedsWhenSecondaryRepoFails: Verifies that an IOException from the secondary repo is caught and does not stop the removal process.
  • testRemoveFailsWhenPrimaryRepoFails: Verifies that an IOException from the primary repo halts the operation and propagates the exception.
  • All existing tests in NotebookRepoSyncTest continue to pass.

Screenshots (if appropriate)

N/A

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

…ently

Make remove() handle primary/secondary repo failures the same way
save() and move() already do: primary failure propagates the exception,
secondary failure is caught and logged.

- Replace the for-loop with explicit getRepo(0)/getRepo(1) calls
- Remove the TODO comment that requested this change
- Add unit tests for both primary and secondary failure scenarios

@jongyoul jongyoul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the primary/secondary removal failure handling and its unit tests. The behavior is consistent with save() and move().

@jongyoul jongyoul merged commit 7bb88ca into apache:master Jul 12, 2026
17 of 19 checks passed
@jongyoul

Copy link
Copy Markdown
Member

Merged into master (7bb88ca).

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.

2 participants