Targeted test logging API, BDN cluster improvements, and client/libs cleanup#1707
Open
Targeted test logging API, BDN cluster improvements, and client/libs cleanup#1707
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a structured, opt-in test logging event mechanism, expands cluster BenchmarksDotNet (BDN) coverage to include AOF-enabled scenarios, and applies a broad set of async/await hygiene and small cleanup changes across server, cluster, client, and Tsavorite components.
Changes:
- Added typed test logging event types/extensions and updated NUnit test logger plumbing to enable targeted log emission.
- Extended BDN cluster benchmarks to support AOF configuration via
ClusterParams/ClusterContext. - Applied widespread
ConfigureAwait(false)and small documentation/formatting cleanups across libs (server/cluster/client/Tsavorite).
Reviewed changes
Copilot reviewed 56 out of 59 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Garnet.test/TestUtils.cs | Returns (ILoggerFactory, NUnitLoggerProvider) so tests can enable targeted logging flags. |
| test/Garnet.test/RespMetricsTest.cs | Updated call site for new logger factory tuple return. |
| test/Garnet.test/NUnitLoggerProvider.cs | Adds event-flag filtering support for typed test logging events. |
| test/Garnet.test/Extensions/BulkRead.cs | Improves command comment format; adds Name constant. |
| test/Garnet.test/Extensions/BulkIncrementBy.cs | Improves command comment format; adds Name; discards unused arg. |
| test/Garnet.test.cluster/ClusterTestContext.cs | Tracks logger provider and exposes helper to enable specific test logging events. |
| libs/common/Testing/GarnetTestLoggingEventType.cs | Introduces GarnetTestLoggingEventType, GarnetTestLoggingEvent, and ILogger.LogTesting extension. |
| libs/common/Testing/ExceptionInjectionType.cs | Moves/extends exception injection enum into Testing/. |
| libs/common/Testing/ExceptionInjectionHelper.cs | Moves/extends exception injection helper into Testing/. |
| benchmark/BDN.benchmark/Cluster/ClusterParams.cs | Adds AOF enablement parameter and updates ToString() to reflect flags. |
| benchmark/BDN.benchmark/Cluster/ClusterOperations.cs | Adds AOF scenario to parameter provider; passes ClusterParams through setup. |
| benchmark/BDN.benchmark/Cluster/ClusterMigrate.cs | Updates single-instance setup call to accept ClusterParams. |
| benchmark/BDN.benchmark/Cluster/ClusterContext.cs | Applies ClusterParams to server options, enabling AOF “null device” configuration for benchmarks. |
| benchmark/BDN.benchmark/BDN.benchmark.csproj | Formatting/whitespace normalization. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/StorageOperations.cs | Adds ConfigureAwait(false) to async waits. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/StorageErrorHandler.cs | Adds ConfigureAwait(false) to async waits. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/BlobUtilsV12.cs | Adds ConfigureAwait(false) to Azure SDK calls. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/BlobManager.cs | Adds ConfigureAwait(false) across lease/maintenance async waits. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/BlobEntry.cs | Adds ConfigureAwait(false) on async blob operations/retries. |
| libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs | Adds ConfigureAwait(false) and adjusts write continuation/semaphore release logic. |
| libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs | Adds ConfigureAwait(false) for cancellation helper. |
| libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs | Calls consumer.Throttle() in bulk consume path. |
| libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogRecoveryInfo.cs | Fixes spelling in XML doc comment. |
| libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs | Minor doc fix, named arg usage, and comment cleanup. |
| libs/storage/Tsavorite/cs/src/core/TsavoriteLog/LogCommitPolicy.cs | Adds ConfigureAwait(false) inside background commit delay. |
| libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs | Adds ConfigureAwait(false) for checkpoint/resize async calls. |
| libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/Revivification/CheckEmptyWorker.cs | Adds ConfigureAwait(false) in worker delay. |
| libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs | Adds ConfigureAwait(false) to recovery async calls. |
| libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs | Removes unused whitespace; removes unsafe from callback signature. |
| libs/storage/Tsavorite/cs/src/core/Index/Common/LogSizeTracker.cs | Adds ConfigureAwait(false) on resize wait. |
| libs/storage/Tsavorite/cs/src/core/Index/Checkpointing/StateMachineDriver.cs | Adds ConfigureAwait(false) to async waits. |
| libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs | Improves exception message with more diagnostic info. |
| libs/storage/Tsavorite/cs/src/core/Device/RandomAccessLocalStorageDevice.cs | Adds ConfigureAwait(false) on file writes. |
| libs/server/TaskManager/TaskManager.cs | Adds ConfigureAwait(false) across task cancellation/waits. |
| libs/server/Storage/Session/MainStore/AdvancedOps.cs | Removes extra blank line. |
| libs/server/Servers/StoreApi.cs | Adds ConfigureAwait(false) for commit waits. |
| libs/server/Resp/AsyncProcessor.cs | Adds ConfigureAwait(false) to async processing task and wait. |
| libs/server/Objects/ItemBroker/CollectionItemBroker.cs | Adds ConfigureAwait(false) on broker waits and queue operations. |
| libs/server/Metrics/Info/InfoCommand.cs | Removes extra blank line. |
| libs/server/Metrics/GarnetServerMonitor.cs | Adds ConfigureAwait(false) to monitor delay. |
| libs/common/Networking/TcpNetworkHandlerBase.cs | Adds ConfigureAwait(false) on TLS receive await. |
| libs/common/LightClient.cs | Adds ConfigureAwait(false) on connection attempts. |
| libs/common/Format.cs | Adds ConfigureAwait(false) for endpoint connect probes. |
| libs/cluster/Session/RespClusterBasicCommands.cs | Adds XML seealso pointing to updated client publish helper. |
| libs/cluster/Server/Migration/MigrationDriver.cs | Adds ConfigureAwait(false) in migration flow. |
| libs/cluster/Server/Migration/MigrateSessionSlots.cs | Adds ConfigureAwait(false) to migrate task creation. |
| libs/cluster/Server/Gossip/GarnetServerNode.cs | Passes internal cancellation token to gossip calls; uses updated publish helper name. |
| libs/cluster/Server/Gossip/GarnetClusterConnectionStore.cs | Adds ConfigureAwait(false) to write-lock acquisition. |
| libs/cluster/Server/Gossip/GarnetClientExtensions.cs | Renames/clarifies cluster helper methods and adds XML docs for no-response publish. |
| libs/cluster/Server/Failover/ReplicaFailoverSession.cs | Adds ConfigureAwait(false) to key awaits and task-run delegates. |
| libs/cluster/Server/Failover/PrimaryFailoverSession.cs | Uses renamed cluster replication-offset helper and adds ConfigureAwait(false) in awaits. |
| libs/cluster/Server/Failover/FailoverManager.cs | Adds ConfigureAwait(false) in background failover tasks. |
| libs/cluster/Server/ClusterConfig.cs | Suppresses a warning log by commenting it out. |
| libs/client/Utility.cs | Adds ConfigureAwait(false) for cancellation helper. |
| libs/client/LightEpoch.cs | Improves exception message with more diagnostic info. |
| libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs | Adds ConfigureAwait(false) to awaited TCS tasks. |
| libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs | Adds ConfigureAwait(false) to string decrement path. |
| libs/client/GarnetClient.cs | Adds client-name “set info” calls; adds ConfigureAwait(false) in multiple awaits. |
| libs/client/ClientSession/GarnetClientSession.cs | Adds ConfigureAwait(false) on connect logic awaits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a targeted logging API for tests, benchmark improvements for cluster scenarios, and miscellaneous cleanup across libs.
Changes
Targeted Test Logging API
GarnetTestLoggingEventTypeenum andGarnetTestLoggingEventstruct inlibs/common/Testing/for structured test log eventsLogTestingextension method onILoggerto emit typed test log messagesNUnitLoggerProviderto support filtering and formatting ofGarnetTestLoggingEvententriesExceptionInjectionHelper/ExceptionInjectionTypeintoTesting/subdirectory and extended injection typesBDN Benchmark Changes
ClusterContextto acceptClusterParamswith AOF configuration supportClusterParamsfor more flexible benchmark configurationsClient & Libs Cleanup
libs/client(GarnetClient API improvements)ConfigureAwaitcalls across libsConfiguration
EnableVectorSetPreviewandVectorSetReplayTaskCountserver options with validation (RequiresMinimumMemoryattribute)defaults.conf