Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C#] Refactor retry logic to ensure stability in InternalRMW et al. (#…
…727) * Fix missing Tombstone check in ReadOnly for RMW/Upsert Delete doesn't need to do anything if record is already deleted Add Unseal() on InternalContinuePendingRMW (as InternalContinuePendingRead does) Add UTs to verify Recover() clears locks Add an Assert in MultiThreadTests to perhaps provide info on intermittent "output.Memory" null ref * WIP: Refactor to move epoch-releases outside InternalXxx functions - Add HandleImmediateRetryStatus to replace "internalStatus == RETRY_NOW" in loops that call InternalXxx and pending IO continuation routines - Ensure RETRY_LATER, rather than RETRY_NOW, is used in places such as sealing that require a subsequent operation by another thread (such as inserting a new record) to bring things to a final state (this removes some race conditions) - Remove FasterExecutionContext.retryRequests and all related routines - Minimize HandleOperationStatus; it's now mostly to enqueue the IO - Update *Async.cs accordingly - Update ReadAsync.cs to handle the fact that allocation can fail in Read due to PendingContext.CopyReadsToTailFromReadOnly - Remove unused InternalCompletePendingRequestsAsync - Change some names for clarity * Finish revisions for HandleImmediateRetryStatus: - Finish converting ReadAsync to handle retry due to memory allocation failures (which may then lead to a pending IO); it now uses the same infrastructure as RMWAsync - Further tighten up *Async.cs handling of sync vs. async IO, removing the need for some IUpdateAsyncOperation methods since it can be handled by UpdateAsync - Fixes for the previous commit for: - Compaction - BlockAllocate(ReadCache) for TryAllocate returning -1 - Back out a change to LockTable.Get that was better handled by one caller - InternalRmw shoudl not fall through to SkipAndInvalidateReadCache if RECORD_ON_DISK - Remove some mistaken and investigation-only Debug.Asserts - Add HandleImmediateRetryStatus to some other places it was needed - Make TryCompletePendingSyncIO handle all CompletePendingWithOutput cases so the caller knows whether to issue another TryCompleteSync() - * Stressie: fix Read/RMW when deletes are present * - Remove redundant calls to OperationStatusUtils.TryConvertToCompletedStatusCode (most are already done within HandleOperationStatus) - Rename the reaccache chain stress tests for clarity in CI log output, and use a larger hashtable size (the previous one was almost identical to Modulo.Thousand) * Rename UpdateAsync to AsyncOperation, since ReadAsync uses it now also * Squashed commit of the following: commit e239009 Author: Badrish Chandramouli <badrishc@microsoft.com> Date: Tue Aug 2 17:22:01 2022 -0700 minor fix commit 1a742b6 Author: Badrish Chandramouli <badrishc@microsoft.com> Date: Tue Aug 2 14:59:31 2022 -0700 Apply same fix to Delete commit 008c173 Author: Badrish Chandramouli <badrishc@microsoft.com> Date: Tue Aug 2 11:57:05 2022 -0700 * After acquiring a latch, we should never return from InternalXxx without going to LatchRelease. * Add Retry status to LatchDestination so that we do not create pending context for retry scenarios. commit 11cc933 Author: Badrish Chandramouli <badrishc@microsoft.com> Date: Tue Aug 2 10:11:31 2022 -0700 Special case common methods to optimize reade ath Materialize session read flags merged to store read flags Optimize common case for HandleImmediateRetryStatus Add thread yield to retry now Co-authored-by: Badrish Chandramouli <badrishc@microsoft.com>
- Loading branch information