-
Notifications
You must be signed in to change notification settings - Fork 591
HDDS-13799. Revert "HDDS-12982. Reduce log level for snapshot validation failure (#8851)" #9162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -292,17 +292,19 @@ public static UUID getLatestPathSnapshotId(String volumeName, String bucketName, | |||||||||||||||||||||||||||||||||||||||||
| return snapshotChainManager.getLatestPathSnapshotId(snapshotPath); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| public static boolean validatePreviousSnapshotId(SnapshotInfo snapshotInfo, | ||||||||||||||||||||||||||||||||||||||||||
| // Validates the previous path snapshotId for given a snapshotInfo. In case snapshotInfo is | ||||||||||||||||||||||||||||||||||||||||||
| // null, the snapshotInfo would be considered as AOS and previous snapshot becomes the latest snapshot in the global | ||||||||||||||||||||||||||||||||||||||||||
| // snapshot chain. Would throw OMException if validation fails otherwise function would pass. | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+295
to
+297
|
||||||||||||||||||||||||||||||||||||||||||
| // Validates the previous path snapshotId for given a snapshotInfo. In case snapshotInfo is | |
| // null, the snapshotInfo would be considered as AOS and previous snapshot becomes the latest snapshot in the global | |
| // snapshot chain. Would throw OMException if validation fails otherwise function would pass. | |
| /** | |
| * Validates the previous path snapshot ID for the given {@link SnapshotInfo}. | |
| * <p> | |
| * If {@code snapshotInfo} is {@code null}, the latest global snapshot ID from the | |
| * snapshot chain is used for validation. This is typically the case when operating | |
| * on the active object store (AOS), i.e., when no snapshot context is provided. | |
| * <p> | |
| * If the expected previous snapshot ID does not match the actual previous snapshot ID, | |
| * this method throws an {@link OMException} with {@code INVALID_REQUEST}. | |
| * | |
| * @param snapshotInfo The snapshot information to validate against. If {@code null}, | |
| * the latest global snapshot is used. | |
| * @param snapshotChainManager The manager for snapshot chains. | |
| * @param expectedPreviousSnapshotId The expected previous snapshot ID to validate. | |
| * @throws OMException if the expected previous snapshot ID does not match the actual previous snapshot ID. | |
| * @throws IOException if an I/O error occurs during validation. | |
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Now that validatePreviousSnapshotId throws OMException (INVALID_REQUEST) for a client-side validation failure, consider catching OMException separately to avoid logging an expected client error at ERROR level and to return a typed error response. For example: catch (OMException e) { return new OMKeyPurgeResponse(createErrorOMResponse(omResponse, e)); } then have a separate catch (IOException e) for genuine IO errors.