Skip to content

Targeted test logging API, BDN cluster improvements, and client/libs cleanup#1707

Open
vazois wants to merge 10 commits intodevfrom
vazois/mlog-cleanup
Open

Targeted test logging API, BDN cluster improvements, and client/libs cleanup#1707
vazois wants to merge 10 commits intodevfrom
vazois/mlog-cleanup

Conversation

@vazois
Copy link
Copy Markdown
Contributor

@vazois vazois commented Apr 16, 2026

Summary

Introduces a targeted logging API for tests, benchmark improvements for cluster scenarios, and miscellaneous cleanup across libs.

Changes

Targeted Test Logging API

  • Added GarnetTestLoggingEventType enum and GarnetTestLoggingEvent struct in libs/common/Testing/ for structured test log events
  • Added LogTesting extension method on ILogger to emit typed test log messages
  • Updated NUnitLoggerProvider to support filtering and formatting of GarnetTestLoggingEvent entries
  • Moved ExceptionInjectionHelper/ExceptionInjectionType into Testing/ subdirectory and extended injection types

BDN Benchmark Changes

  • Updated ClusterContext to accept ClusterParams with AOF configuration support
  • Added AOF-related parameters to ClusterParams for more flexible benchmark configurations

Client & Libs Cleanup

  • Cherry-picked fixes for libs/client (GarnetClient API improvements)
  • Added missing ConfigureAwait calls across libs

Configuration

  • Exposed EnableVectorSetPreview and VectorSetReplayTaskCount server options with validation (RequiresMinimumMemory attribute)
  • Added corresponding defaults in defaults.conf

Copilot AI review requested due to automatic review settings April 16, 2026 20:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread test/Garnet.test/NUnitLoggerProvider.cs Outdated
Comment thread test/Garnet.test/NUnitLoggerProvider.cs
Comment thread libs/cluster/Session/RespClusterBasicCommands.cs Outdated
Comment thread libs/cluster/Server/ClusterConfig.cs
Comment thread benchmark/BDN.benchmark/Cluster/ClusterParams.cs Outdated
Comment thread libs/common/Testing/GarnetTestLoggingEventType.cs Outdated
Comment thread libs/common/Testing/GarnetTestLoggingEventType.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants