Skip to content

[Bug]: Sysbench read_write intermittently fails with fileservice idle-source timeout #32792

Open

Description

@Ariznawlll

Description

Main nightly Sysbench read-write encounters real server-side fileservice idle-source timeouts under the 1TP+2AP weekly workload. This is an observed supported-workload failure; its product versus infrastructure root cause is not yet established and requires investigation.

Environment

Steps to reproduce

  1. Run the documented weekly TKE TP/AP family workload, including Sysbench 1000W read_write / 1000 threads and concurrent AP TPCH 1T loading, using the version and resources above.
  2. Observe Sysbench client errors and matching TP CN server logs. This is a workload-level reproducer, not yet a minimized deterministic reproduction.

Actual behavior

At 2026-11-15 17:15:20.970 UTC, client and TP server reported 20101 fileservice: no bytes from the source within the idle timeout for SELECT c FROM sbtest8 WHERE id=9537982; an UPDATE on sbtest5 failed with the same error immediately afterwards. The configured source idle interval in this version is 20 seconds. The case did not complete successfully.

Expected behavior

Valid reads and updates complete without fileservice idle timeout under the declared workload and resource contract.

Stability and controls

Evidence and analysis

  • TP server readutil/reader.go:877 and frontend/session.go:4912 confirm the same failure as the client. TP CPU 2-minute average was 13.75/14 cores and CFS throttled-period ratio 75.4%; the latter is not percentage of CPU time lost.
  • During 17:05–17:20 UTC, TN S3 read rate was roughly 743–778 MB/s (two-minute rate); goroutine samples contain merge-object → load block → S3FS.Read. TN logged merge scheduler pause for its low available-memory budget. This is not proof of OOM kill or that TPCH caused all the traffic or the timeout.
  • Need request/object-level latency and network/storage evidence to discriminate product fileservice behavior from shared-resource or infrastructure contention. No regression commit is established.

Regression coverage

After diagnosis, add a targeted read/write and fileservice regression with controlled shared-I/O load and assertions for errors, data correctness, cleanup and cancellation.

Related

Activity

  1. added theissue type on Nov 16, 2026
  2. added this to the MO-202611 milestone on Nov 16, 2026
  3. jiangxinmeng1 commented on Nov 16, 2026

    @jiangxinmeng1
    Contributor

    I traced the exact server error fileservice: no bytes from the source within the idle timeout to PR #32697, merged into main as b465f868241 on 2026-11-14. That commit added sourceIdleTimeout = readWriteTimeout (20 seconds), idleReader, and this error string in pkg/fileservice/disk_cache_download.go. Its parent does not contain the check. The failing MO SHA 294076edf4965fdccce9eeddfca80bfa15f49098 contains it; the comparison SHA 5009da9d29cad96ea4a8ad120af061aa1bc539e2 does not.

    PR #32382 was a stacked dependency of #32697, but #32382 itself was closed without merging. The check entered main through #32697.

    This establishes which PR introduced the 20-second idle-source check and error. It does not yet establish that the PR caused the underlying source-read stalls. In the failing TP CN, both a range read and a whole-object/cache-fill read took about 20 seconds immediately before the SQL errors; the source of those stalls still needs investigation.

  4. cpegeric commented on Nov 16, 2026

    @cpegeric
    Contributor

    Root cause found and reproduced. The 20 s idle timeout from #32697 also counts the time a read waits for a free connection in the HTTP pool, not only stalls of a download in progress.

    Mechanism

    • What the timer covers. idleReader (disk_cache_download.go:346-379) starts its timer at the first Read. Both object readers send their GET lazily, on that first Read:
      • the whole-object fill uses lazyObjectReader;
      • range flights use the retryable reader.
    • What that means under load. When all max-conns-per-host connections (128) are busy, the GET waits in net/http.(*Transport).getConn, and that wait runs on the 20 s idle clock.
    • What changed. Before perf(fileservice): keep IVF-Flat entries objects in the index-file cache #32697 this wait was bounded only by the query's context, so a busy pool meant waiting, never an error. The pool size did not shrink: perf(fileservice): keep IVF-Flat entries objects in the index-file cache #32697 raised it from 100 to 128.
    • Which path errors. Only the whole-object cache fill (readFullObjectToDiskCacheStreaming) passes the error to the query. A failed range flight falls back to the reader fetching its own bytes, so there the error becomes a long wait instead.

    Reproduction

    • Setup. S3FS against local MinIO, 256 objects of 8 MiB, a 512 MiB disk cache so misses continue, and concurrent 4 KiB random reads.
    • Scaling. The idle timeout was scaled from 20 s down to 100 ms–1 s, because local MinIO answers in milliseconds.
    max-conns-per-host readers idle timeout idle errors note
    128 512 1 s 0
    13 (1/10) 512 1 s 0 reads waited up to 21 s, but the error was absorbed by the range fallback
    13 1024 100 ms 7
    128 2048 100 ms 8957
    128, whole-object preloads off 2048 100 ms 0

    A goroutine profile in the 13-connection run showed 308 reads parked in Transport.getConn under idleReader.Read.

    Fix (PR to follow)

    1. Start the idle timer at the first byte received. Waiting for a connection and for the response headers is then bounded by the query's context, as before perf(fileservice): keep IVF-Flat entries objects in the index-file cache #32697. A body that stalls mid-download is still detected. A test build of this change gave:

      max-conns-per-host readers idle timeout idle errors before → after reads before → after
      128 2048 100 ms 8772 → 0 246k → 319k
      13 1024 100 ms 7 → 0 237k → 240k
    2. Let a failed whole-object fill fall back to range reads, as a failed range flight already does, instead of failing the query.

    Queueing for connections remains under extreme contention: with 13 connections, reads still waited up to 17 s. That is waiting, not an error. #32796 (remote scans reading block by block, without prefetch) adds to the connection pressure on AP CNs, and its fix should reduce it.

  5. cpegeric commented on Nov 16, 2026

    @cpegeric
    Contributor

    Fixed in #32812, which lands #32697 again after its revert in #32809.

    The rule now:

    • While a read waits for a download — the read that started it, or one that joined it — the download is bounded only by that read's context. Waiting for a connection, the response or a byte has no other timeout.
    • Once no read waits, a download whose source sends nothing for 20 s stops silently. That frees its connection and memory. No read fails, and a later read fetches its own bytes.

    Same MinIO starvation load as above, against the fix:

    max-conns-per-host readers idle timeout idle errors, main idle errors, fix
    128 2048 100 ms 8957 0
    13 1024 100 ms 7 0
    13 512 1 s 0 0
  6. cpegeric commented on Nov 24, 2026

    @cpegeric
    Contributor

    Decision (2026-11-24, won't change): max-conns-per-host below 64 is rejected at startup.

    This answers the review finding on object_storage_arguments.go:197 (1–63 now fails file-service initialization).

    • An object-storage client with fewer than 64 connections per host is a misconfiguration for a database. Every table read, write, listing, delete and prefetch download waits on the same few connections. A limit of 1 is a bug, not a supported setup.
    • 0 keeps the default pool (128 per host). Any value of at least 64 is used as configured, and background downloads hold at most half of it.
    • A released configuration that sets 1–63 must be changed to 0 or to at least 64 before upgrading. The startup error names the setting and the value.

    This is recorded in docs/design/20261110-object-prefetcher.md (Compatibility, rollout and operations).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions