mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/logstorage: always check the previous indexBlockHeader for blocks with matching tenantID and/or streamID
The previous indexBlockHeader may contain blocks for the matching tenantID and/or streamID,
so it must be scanned unconditionally during the search.
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5295
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4856
This is a follow-up for 89dcbc2fe7
This commit is contained in:
parent
89dcbc2fe7
commit
cef7a39ba3
@ -18,6 +18,7 @@ according to [these docs](https://docs.victoriametrics.com/VictoriaLogs/QuickSta
|
||||
|
||||
## tip
|
||||
|
||||
* BUGFIX: properly locate logs for the [requested streams](https://docs.victoriametrics.com/VictoriaLogs/LogsQL.html#stream-filter). Previously logs for some streams may be missing in query results. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4856). Thanks to @XLONG96 for [the fix](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5295)!
|
||||
* BUGFIX: [web UI](https://docs.victoriametrics.com/VictoriaLogs/querying/#web-ui): properly sort found logs by time. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5300).
|
||||
|
||||
|
||||
|
@ -382,10 +382,8 @@ func (p *part) searchByTenantIDs(so *searchOptions, bhss *blockHeaders, workCh c
|
||||
n = sort.Search(len(ibhs), func(i int) bool {
|
||||
return !ibhs[i].streamID.tenantID.less(tenantID)
|
||||
})
|
||||
if n == len(ibhs) || n > 0 && !ibhs[n].streamID.tenantID.equal(tenantID) {
|
||||
// The end of ibhs[n-1] may contain blocks for the given tenantID, so move it backwards
|
||||
n--
|
||||
}
|
||||
// The end of ibhs[n-1] may contain blocks for the given tenantID, so move it backwards
|
||||
n--
|
||||
}
|
||||
ibh := &ibhs[n]
|
||||
ibhs = ibhs[n+1:]
|
||||
@ -493,10 +491,8 @@ func (p *part) searchByStreamIDs(so *searchOptions, bhss *blockHeaders, workCh c
|
||||
n = sort.Search(len(ibhs), func(i int) bool {
|
||||
return !ibhs[i].streamID.less(streamID)
|
||||
})
|
||||
if n == len(ibhs) || n > 0 && !ibhs[n].streamID.equal(streamID) {
|
||||
// The end of ibhs[n-1] may contain blocks for the given streamID, so move it backwards
|
||||
n--
|
||||
}
|
||||
// The end of ibhs[n-1] may contain blocks for the given streamID, so move it backwards.
|
||||
n--
|
||||
}
|
||||
ibh := &ibhs[n]
|
||||
ibhs = ibhs[n+1:]
|
||||
|
Loading…
Reference in New Issue
Block a user