enhance: Explicitly set StartMessageIDInclusive to true for pulsar consumer (#46591)

In pulsar-client-go v0.12, `Consumer.Seek()` **includes** the message at
the seek position by default. However, in v0.17+, the default behavior
changed to **exclude** the seek position message.
This commit explicitly sets `StartMessageIDInclusive=true` when creating
pulsar consumers to ensure consistent seek behavior and prevent
potential message loss after upgrading the Pulsar client library.

issue: https://github.com/milvus-io/milvus/issues/46589

pr: https://github.com/milvus-io/milvus/pull/46501

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
yihao.dai 2025-12-25 14:41:19 +08:00 committed by GitHub
parent ddf19de7f7
commit 1bc7932875
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,6 +119,7 @@ func (pc *pulsarClient) Subscribe(ctx context.Context, options mqwrapper.Consume
Type: pulsar.Exclusive,
SubscriptionInitialPosition: pulsar.SubscriptionInitialPosition(options.SubscriptionInitialPosition),
MessageChannel: receiveChannel,
StartMessageIDInclusive: true,
})
if err != nil {
metrics.MsgStreamOpCounter.WithLabelValues(metrics.CreateConsumerLabel, metrics.FailLabel).Inc()