Skip to content

find_queries_by_text can still stop at its budget with no span finished, so the search returns no rows #9219

Closed

Description

@erikdarlingdata

Claude posting for Erik Darling.

What

Build 3.13.0-nightly.20261121.714. #9150 (closed by #9154) asked for two things: a search cut by the budget returns what it found, and it names the span it searched. The second is done: every reply carries searched with complete, searched_from and searched_to. The first does not hold when the budget runs out before the first span finishes. The reply then says nothing was searched, has complete: false with searched_from and searched_to null, and returns no rows, which is the answer #9150 set out to remove.

Seen on both SQL Server stores tried:

  • All servers, a common pattern (no server_name): stopped at the 4 s budget with nothing searched, every time it was tried.
  • One server, a rare pattern, no database: with limit 3 it stopped with nothing searched twice in a row; with limit 2 it answered ok and complete: true in under a second with rows; with the default limit it stopped after the newest few hours of the raw tier, with rows and the covered span named. So whether the first span finishes in time changes from call to call with the same pattern, server and window.

A user who gets an empty stopped reply cannot tell a pattern that is not there from one the search never reached, and the only advice it gives is to name a database, which the all-servers shape cannot take.

Proposed

  • Size the first span to the budget: start with the newest slice of the raw tier and widen it only while time remains, so a stopped search always returns the newest matches with the span it covered. The all-servers and one-server shapes share this.
  • For the all-servers shape, when the digest probe has matched texts, read the samples newest first and stop at the budget, rather than joining the whole raw window.
  • Keep searched as it is.

Tests

  • All-servers search for a common pattern on a seeded store with a long history and a budget the full window cannot meet: returns at least the newest matches, searched_from is set, complete is false.
  • One-server search for a rare pattern with no database at limits 1, 2, 3 and the default, under the same tight budget: none stops with searched_from null.
  • A search that finishes reports complete: true and the full window, as today.
  • A pattern that is not there answers empty and complete: true, not stopped.

Activity

  1. added
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Nov 21, 2026
  2. erikdarlingdata commented on Nov 21, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling.

    Fixed on dev by #9230.

  3. erikdarlingdata commented on Nov 21, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling.

    #9230 is merged to dev. This issue stays open until the all-servers search is timed again on a large store, after the nightly build that carries the change. It passes when an all-servers search for a common pattern returns rows with searched_from set, instead of stopping at the time budget with nothing.

  4. added
    waitingOwned, nothing in flight: waits on a named event. The last comment names it.
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressActively being worked by a local session or its agents (PR open or in flight)waitingOwned, nothing in flight: waits on a named event. The last comment names it.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions