Commit 7bb88ca
authored
[ZEPPELIN-6453] Handle secondary NotebookRepo remove failures consistently
### 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?
* https://issues.apache.org/jira/browse/ZEPPELIN-6453
### 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
Closes #5289 from move-hoon/ZEPPELIN-6453-remove-secondary-failure.
Signed-off-by: Jongyoul Lee <jongyoul@gmail.com>1 parent dfd8cf7 commit 7bb88ca
2 files changed
Lines changed: 69 additions & 3 deletions
File tree
- zeppelin-server/src
- main/java/org/apache/zeppelin/notebook/repo
- test/java/org/apache/zeppelin/notebook/repo
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
213 | 219 | | |
214 | | - | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
434 | 442 | | |
435 | 443 | | |
436 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
437 | 498 | | |
0 commit comments