[SERVER-32268] Add SnapshotTooOld and SnapshotUnavailable exception Created: 11/Dec/17  Updated: 06/Dec/22  Resolved: 20/Mar/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Misha Tyulenev Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-33013 Add snapshot errors Closed
Assigned Teams:
Sharding
Participants:

 Description   

Original Ticket:

The SnapshotTooOld be returned from individual shards. This task adds a
StaleSnapshotError error class to error_codes.err that includes ["StaleConfig", "StaleShardVersion", "StaleEpoch", "SnapshotUnavailable", "SnapshotTooOld"] errors
the purpose or this error class is to restart targeting if the snapshot is unavailable or shard version is stale.

As an alternative approach use only ["SnapshotUnavailable", "SnapshotTooOld"] - that will allow to make implementation different handling for SnapshotErrors.


Summary:

Add a new error codes and a new error class to catch snapshot errors that require retrying establishing a global snapshot. This includes: ["SnapshotTooOld", "SnapshotUnavailable"]. "SnapshotTooOld" has already been added as part of Local Snapshot Reads, so only "SnapshotUnavailable" needs to be added.

Details:

In src/mongo/base/error_codes.err:

error_code("SnapshotTooOld", <number>)
error_code("SnapshotUnavailable", <number>)
 
...
 
error_class("SnapshotTargetingError", ["SnapshotTooOld", "SnapshotUnavailable"])

POC: https://mongodbcr.appspot.com/184550001


Generated at Thu Feb 08 04:29:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.