Skip to content

Commit f55f900

Browse files
authored
fix insert hang caused by WAL writer writing to a closing logfile (milvus-io#42078)
related issue milvus-io#42049 wp commit [94de4](zilliztech/woodpecker@94de4cb) Signed-off-by: tinswzy <[email protected]>
1 parent e479467 commit f55f900

File tree

8 files changed

+33
-23
lines changed

8 files changed

+33
-23
lines changed

configs/milvus.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,23 @@ woodpecker:
187187
queueSize: 10000 # The size of the queue for pending messages to be sent of each log.
188188
maxRetries: 3 # Maximum number of retries for segment append operations.
189189
segmentRollingPolicy:
190-
maxSize: 2GB # Maximum entries count of a segment, default is 2GB
190+
maxSize: 128M # Maximum entries count of a segment, default is 128M
191191
maxInterval: 10m # Maximum interval between two segments, default is 10 minutes.
192192
auditor:
193193
maxInterval: 10s # Maximum interval between two auditing operations, default is 10 seconds.
194194
logstore:
195195
logFileSyncPolicy:
196196
maxInterval: 200ms # Maximum interval between two sync operations, default is 200 milliseconds.
197-
maxBytes: 64M # Maximum size of write buffer in bytes.
198-
maxEntries: 100000 # Maximum entries number of write buffer.
197+
maxBytes: 32M # Maximum size of write buffer in bytes.
198+
maxEntries: 10000 # Maximum entries number of write buffer.
199199
maxFlushRetries: 5 # Maximum size of write buffer in bytes.
200200
retryInterval: 1000ms # Maximum interval between two retries. default is 1000 milliseconds.
201201
maxFlushSize: 8M # Maximum size of a fragment in bytes to flush, default is 8M.
202202
maxFlushThreads: 4 # Maximum number of threads to flush data
203+
logFileCompactionPolicy:
204+
maxSize: 8M # The maximum size of the merged files, default is 8M.
203205
fragmentManager:
204-
maxBytes: 512M # Maximum size of fragment cached data in bytes.
206+
maxBytes: 128M # Maximum size of fragment cached data in bytes.
205207
maxInterval: 1s # Maximum interval between two fragment evicts. default is 1 second
206208
storage:
207209
type: minio # The Type of the storage provider. Valid values: [minio, local]

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ require (
243243
github.com/x448/float16 v0.8.4 // indirect
244244
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
245245
github.com/yusufpapurcu/wmi v1.2.4 // indirect
246-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03 // indirect
246+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22 // indirect
247247
go.etcd.io/bbolt v1.3.6 // indirect
248248
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
249249
go.etcd.io/etcd/client/v2 v2.305.5 // indirect

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,6 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO
474474
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
475475
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
476476
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
477-
github.com/google/gops v0.3.28 h1:2Xr57tqKAmQYRAfG12E+yLcoa2Y42UJo2lOrUFL9ark=
478-
github.com/google/gops v0.3.28/go.mod h1:6f6+Nl8LcHrzJwi8+p0ii+vmBFSlB4f8cOOkTJ7sk4c=
479477
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
480478
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
481479
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -1066,8 +1064,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
10661064
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
10671065
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
10681066
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
1069-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03 h1:79e9xOq1BU102KutPMQegP3ItGb9BbDbi7BE2ii8Leo=
1070-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03/go.mod h1:476FWuCIVwvrN/qc+rNxunoMTgC07FW4oc/fMDg4f0A=
1067+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22 h1:Yb1t/yyELWoFyVde0AWIsjF+fwqYdo1VVv7yqhHhIvM=
1068+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22/go.mod h1:MeyFx9vsAzxEysO2wzMC5d1QcSknbfVZOAhEmyxgQbo=
10711069
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
10721070
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
10731071
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=

pkg/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require (
3939
github.com/tikv/client-go/v2 v2.0.4
4040
github.com/uber/jaeger-client-go v2.30.0+incompatible
4141
github.com/x448/float16 v0.8.4
42-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03
42+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22
4343
go.etcd.io/etcd/api/v3 v3.5.5
4444
go.etcd.io/etcd/client/v3 v3.5.5
4545
go.etcd.io/etcd/server/v3 v3.5.5

pkg/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO
361361
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
362362
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
363363
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
364-
github.com/google/gops v0.3.28 h1:2Xr57tqKAmQYRAfG12E+yLcoa2Y42UJo2lOrUFL9ark=
365-
github.com/google/gops v0.3.28/go.mod h1:6f6+Nl8LcHrzJwi8+p0ii+vmBFSlB4f8cOOkTJ7sk4c=
366364
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
367365
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
368366
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -824,8 +822,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
824822
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
825823
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
826824
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
827-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03 h1:79e9xOq1BU102KutPMQegP3ItGb9BbDbi7BE2ii8Leo=
828-
github.com/zilliztech/woodpecker v0.0.0-20250522011808-4059b68a0e03/go.mod h1:476FWuCIVwvrN/qc+rNxunoMTgC07FW4oc/fMDg4f0A=
825+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22 h1:Yb1t/yyELWoFyVde0AWIsjF+fwqYdo1VVv7yqhHhIvM=
826+
github.com/zilliztech/woodpecker v0.0.0-20250602050237-2822b5a11b22/go.mod h1:MeyFx9vsAzxEysO2wzMC5d1QcSknbfVZOAhEmyxgQbo=
829827
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
830828
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
831829
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=

pkg/streaming/walimpls/impls/wp/builder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func (b *builderImpl) setCustomWpConfig(wpConfig *config.Configuration, cfg *par
104104
wpConfig.Woodpecker.Logstore.LogFileSyncPolicy.MaxFlushSize = cfg.FlushMaxSize.GetAsSize()
105105
wpConfig.Woodpecker.Logstore.LogFileSyncPolicy.MaxFlushThreads = cfg.FlushMaxThreads.GetAsInt()
106106
wpConfig.Woodpecker.Logstore.LogFileSyncPolicy.RetryInterval = int(cfg.RetryInterval.GetAsDurationByParse().Milliseconds())
107+
wpConfig.Woodpecker.Logstore.LogFileCompactionPolicy.MaxBytes = cfg.CompactionSize.GetAsSize()
107108
wpConfig.Woodpecker.Logstore.FragmentManager.MaxBytes = cfg.FragmentCachedMaxBytes.GetAsSize()
108109
wpConfig.Woodpecker.Logstore.FragmentManager.MaxInterval = int(cfg.FragmentCachedInterval.GetAsDurationByParse().Milliseconds())
109110
// storage

pkg/util/paramtable/service_param.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ type WoodpeckerConfig struct {
681681
RetryInterval ParamItem `refreshable:"true"`
682682
FlushMaxSize ParamItem `refreshable:"true"`
683683
FlushMaxThreads ParamItem `refreshable:"true"`
684+
CompactionSize ParamItem `refreshable:"true"`
684685
FragmentCachedMaxBytes ParamItem `refreshable:"true"`
685686
FragmentCachedInterval ParamItem `refreshable:"true"`
686687

@@ -729,8 +730,8 @@ func (p *WoodpeckerConfig) Init(base *BaseTable) {
729730
p.SegmentRollingMaxSize = ParamItem{
730731
Key: "woodpecker.client.segmentRollingPolicy.maxSize",
731732
Version: "2.6.0",
732-
DefaultValue: "2GB",
733-
Doc: "Maximum entries count of a segment, default is 2GB",
733+
DefaultValue: "128M",
734+
Doc: "Maximum entries count of a segment, default is 128M",
734735
Export: true,
735736
}
736737
p.SegmentRollingMaxSize.Init(base.mgr)
@@ -765,7 +766,7 @@ func (p *WoodpeckerConfig) Init(base *BaseTable) {
765766
p.SyncMaxEntries = ParamItem{
766767
Key: "woodpecker.logstore.logFileSyncPolicy.maxEntries",
767768
Version: "2.6.0",
768-
DefaultValue: "100000",
769+
DefaultValue: "10000",
769770
Doc: "Maximum entries number of write buffer.",
770771
Export: true,
771772
}
@@ -774,7 +775,7 @@ func (p *WoodpeckerConfig) Init(base *BaseTable) {
774775
p.SyncMaxBytes = ParamItem{
775776
Key: "woodpecker.logstore.logFileSyncPolicy.maxBytes",
776777
Version: "2.6.0",
777-
DefaultValue: "64M",
778+
DefaultValue: "32M",
778779
Doc: "Maximum size of write buffer in bytes.",
779780
Export: true,
780781
}
@@ -816,10 +817,19 @@ func (p *WoodpeckerConfig) Init(base *BaseTable) {
816817
}
817818
p.FlushMaxThreads.Init(base.mgr)
818819

820+
p.CompactionSize = ParamItem{
821+
Key: "woodpecker.logstore.logFileCompactionPolicy.maxSize",
822+
Version: "2.6.0",
823+
DefaultValue: "8M",
824+
Doc: "The maximum size of the merged files, default is 8M.",
825+
Export: true,
826+
}
827+
p.CompactionSize.Init(base.mgr)
828+
819829
p.FragmentCachedMaxBytes = ParamItem{
820830
Key: "woodpecker.logstore.fragmentManager.maxBytes",
821831
Version: "2.6.0",
822-
DefaultValue: "512M",
832+
DefaultValue: "128M",
823833
Doc: "Maximum size of fragment cached data in bytes.",
824834
Export: true,
825835
}

pkg/util/paramtable/service_param_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,19 @@ func TestServiceParam(t *testing.T) {
103103

104104
assert.Equal(t, wpCfg.AppendQueueSize.GetAsInt(), 10000)
105105
assert.Equal(t, wpCfg.AppendMaxRetries.GetAsInt(), 3)
106-
assert.Equal(t, wpCfg.SegmentRollingMaxSize.GetAsSize(), int64(2*1024*1024*1024))
106+
assert.Equal(t, wpCfg.SegmentRollingMaxSize.GetAsSize(), int64(128*1024*1024))
107107
assert.Equal(t, wpCfg.SegmentRollingMaxTime.GetAsDurationByParse().Seconds(), float64(600))
108108
assert.Equal(t, wpCfg.AuditorMaxInterval.GetAsDurationByParse().Seconds(), float64(10))
109109

110110
assert.Equal(t, wpCfg.SyncMaxInterval.GetAsDurationByParse().Milliseconds(), int64(200))
111-
assert.Equal(t, wpCfg.SyncMaxEntries.GetAsInt(), 100000)
112-
assert.Equal(t, wpCfg.SyncMaxBytes.GetAsSize(), int64(64*1024*1024))
111+
assert.Equal(t, wpCfg.SyncMaxEntries.GetAsInt(), 10000)
112+
assert.Equal(t, wpCfg.SyncMaxBytes.GetAsSize(), int64(32*1024*1024))
113113
assert.Equal(t, wpCfg.FlushMaxRetries.GetAsInt(), 5)
114114
assert.Equal(t, wpCfg.FlushMaxSize.GetAsSize(), int64(8*1024*1024))
115115
assert.Equal(t, wpCfg.FlushMaxThreads.GetAsInt(), 4)
116116
assert.Equal(t, wpCfg.RetryInterval.GetAsDurationByParse().Milliseconds(), int64(1000))
117-
assert.Equal(t, wpCfg.FragmentCachedMaxBytes.GetAsSize(), int64(512*1024*1024))
117+
assert.Equal(t, wpCfg.CompactionSize.GetAsSize(), int64(8*1024*1024))
118+
assert.Equal(t, wpCfg.FragmentCachedMaxBytes.GetAsSize(), int64(128*1024*1024))
118119
assert.Equal(t, wpCfg.FragmentCachedInterval.GetAsDurationByParse().Milliseconds(), int64(1000))
119120

120121
assert.Equal(t, wpCfg.StorageType.GetValue(), "minio")

0 commit comments

Comments
 (0)