Prevent Any Storage Errors from Clobbering aZKS Entry#432
Prevent Any Storage Errors from Clobbering aZKS Entry#432dillongeorge merged 2 commits intofacebook:mainfrom
Conversation
127ea25 to
9b9da58
Compare
CurrentPrior to this patch, AKD would incorrectly assume that any error during initialization of For example, if a connection issue occurs when connecting to the storage layer, the current implementation Proposed/NewWith this change, we update the initialization logic for the |
9b9da58 to
210af9d
Compare
210af9d to
dfc8e77
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #432 +/- ##
==========================================
+ Coverage 88.57% 88.64% +0.07%
==========================================
Files 39 39
Lines 9077 9109 +32
==========================================
+ Hits 8040 8075 +35
+ Misses 1037 1034 -3 ☔ View full report in Codecov by Sentry. |
62b975d to
bc0ad74
Compare
bc0ad74 to
a1848e6
Compare
**Current** -- Prior to this patch, AKD would incorrectly assume that any error during initialization of a `Directory` should result in an `aZKS` being created and stored in the underlying database implementation. The problem here is that this behavior happened on every error, even those which do not definitively indicate that the read for an `aZKS` passed but a record was not found. For example, if a connection issue occurs when connecting to the storage layer, the current implementation could wrongly overwrite an existing `aZKS`. In such a scenario, the original read for the `aZKS` fails during `Directory` initialization, but a subsequent write succeeds. This can result in clobbered records and unexpected behavior. **Proposed/New** -- With this change, we update the initialization logic for the `Directory` type to only create an `aZKS` if the returned `Err` indicates that the read was successful, but an `aZKS` was not found. In all other instances, we propagate the `Err` back to the caller instead of swallowing it and wrongly creating an `aZKS`.
a1848e6 to
7c70de3
Compare
No description provided.