Fix source header name retrieval

Stream subject mapping added index prefix to Nats-Stream-Source which
was stripped when retrieving that header. That caused
startingSequenceForSources to iterate over whole stream because of
name mismatch.
Stripping was removed in this commit.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
This commit is contained in:
Tomasz Pietrek
2023-02-27 13:12:44 +01:00
parent c70290acbb
commit d400664b67

View File

@@ -2850,10 +2850,8 @@ func (mset *stream) processInboundSourceMsg(si *sourceInfo, m *inMsg) bool {
// Generate a new style source header.
func (si *sourceInfo) genSourceHeader(reply string) string {
var b strings.Builder
// strip the source index number from the iname
name := si.iname[strings.IndexRune(si.iname, ':')+1:]
b.WriteString(name)
b.WriteString(si.iname)
b.WriteByte(' ')
// Grab sequence as text here from reply subject.
var tsa [expectedNumReplyTokens]string