Skip to content

Commit

Permalink
Adjust test to have < 64k subjects to test skip logic.
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <[email protected]>
  • Loading branch information
derekcollison authored and wallyqs committed Aug 27, 2024
1 parent 5d3effe commit fd01c02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -6426,9 +6426,6 @@ func (fs *fileStore) LoadNextMsg(filter string, wc bool, start uint64, sm *Store
// We should not do this at all if we are already on the last block.
// Also if we are a wildcard do not check if large subject space.
const wcMaxSizeToCheck = 64 * 1024

// if len(blks) - 1 > N

if i == bi && i < len(fs.blks)-1 && (!wc || fs.psim.Size() < wcMaxSizeToCheck) {
nbi, err := fs.checkSkipFirstBlock(filter, wc, bi)
// Nothing available.
Expand Down
2 changes: 1 addition & 1 deletion server/filestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7760,7 +7760,7 @@ func Benchmark_FileStoreLoadNextMsgVerySparseMsgsLargeTail(b *testing.B) {
// Add in a bunch of msgs.
// We need to make sure we have a range of subjects that could kick in a linear scan.
for i := 0; i < 1_000_000; i++ {
subj := fmt.Sprintf("foo.%d.bar", rand.Intn(100_000)+2)
subj := fmt.Sprintf("foo.%d.bar", rand.Intn(64_000)+2)
fs.StoreMsg(subj, nil, msg)
}

Expand Down

0 comments on commit fd01c02

Please sign in to comment.