Skip to content

Commit

Permalink
MB-53235 leave item quota management to producer for serialized opera…
Browse files Browse the repository at this point in the history
…tors

Change-Id: Ie095b2ff1e22a32db5e092ac6e1442bbf8832185
Reviewed-on: https://review.couchbase.org/c/query/+/178386
Reviewed-by: Donald Haggart <donald.haggart@couchbase.com>
Tested-by: Marco Greco <marco.greco@couchbase.com>
  • Loading branch information
Marco Greco committed Aug 3, 2022
1 parent b2ca880 commit 422c73f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions execution/limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ func (this *Limit) processItem(item value.AnnotatedValue, context *Context) bool
this.limit--
return this.sendItem(item)
} else {
if context.UseRequestQuota() {
context.ReleaseValueSize(item.Size())

// MB-53235 for serialized operators item management rests with the producer
if !this.serialized {
if context.UseRequestQuota() {
context.ReleaseValueSize(item.Size())
}
item.Recycle()
}
item.Recycle()
return false
}
}
Expand Down
12 changes: 8 additions & 4 deletions execution/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ func (this *Stream) processItem(item value.AnnotatedValue, context *Context) boo
this.addOutDocs(1)
}

// item not used past this point
if context.UseRequestQuota() {
context.ReleaseValueSize(item.Size())
// MB-53235 for serialized operators item management rests with the producer
if ok || !this.serialized {

// item not used past this point
if context.UseRequestQuota() {
context.ReleaseValueSize(item.Size())
}
item.Recycle()
}
item.Recycle()
return ok
}

Expand Down

0 comments on commit 422c73f

Please sign in to comment.