mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 22:45:26 +08:00
Introduce a ScannerStartupDelay configuration to enable WAL write-only recovery, allowing fence messages to be persisted during primary–secondary switchover when the StreamingNode is trapped in crash loops. issue: https://github.com/milvus-io/milvus/issues/46368 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a configurable WAL scanner pause/resume and a consumer request flag to optionally ignore pause signals. * **Metrics** * Added a scanner pause gauge and pause-duration tracking for WAL scanning. * **Tests** * Added coverage for pause-consumption behavior and cleanup in stream client tests. * **Chores** * Consolidated flush-all logging into a single field and added a helper for bulk message conversion. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
32 lines
789 B
Go
32 lines
789 B
Go
package log
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
"go.uber.org/zap/zapcore"
|
|
)
|
|
|
|
const (
|
|
FieldNameModule = "module"
|
|
FieldNameComponent = "component"
|
|
)
|
|
|
|
// FieldModule returns a zap field with the module name.
|
|
func FieldModule(module string) zap.Field {
|
|
return zap.String(FieldNameModule, module)
|
|
}
|
|
|
|
// FieldComponent returns a zap field with the component name.
|
|
func FieldComponent(component string) zap.Field {
|
|
return zap.String(FieldNameComponent, component)
|
|
}
|
|
|
|
// FieldMessage returns a zap field with the message object.
|
|
func FieldMessage(msg zapcore.ObjectMarshaler) zap.Field {
|
|
return zap.Object("message", msg)
|
|
}
|
|
|
|
// FieldMessages returns a zap array field with the messages.
|
|
func FieldMessages[T zapcore.ObjectMarshaler](msgs []T) zap.Field {
|
|
return zap.Objects("messages", msgs)
|
|
}
|