Skip to content

Default trace: only strip rollover suffixes in the filename (#1636) - #1638

Merged
erikdarlingdata merged 3 commits into
devfrom
feature/1636-trace-underscore-dir
Jul 24, 2026
Merged

Default trace: only strip rollover suffixes in the filename (#1636)#1638
erikdarlingdata merged 3 commits into
devfrom
feature/1636-trace-underscore-dir

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Summary

Closes #1636 (the residual edge from #1633): the _N rollover strip keyed on the last underscore ANYWHERE in the path, so a relocated default trace in an underscore-named directory with an unsuffixed file mangled to a nonexistent path (/var/opt/my_sql/log/log.trc -> /var/opt/my.trc -> Msg 19049 -> zero events). The strip now fires only when the last underscore sits AFTER the last path separator (both \ and /, since targets are Windows and Linux). Applied to the shared collector (Lite + Darling) and install/29.

Also carries the review follow-ups from the #1630/#1633 community PRs: CHANGELOG entries for both plus this fix, the three CPU comment sites now cite the actual ring-buffer fix (SQL Server 2025 CU1, KB5078298 fix 4796293) rather than implying 2025 RTM (verified against MS Learn), and the #1630 test's DoesNotContain guard normalizes line endings so it cannot pass vacuously on a CRLF checkout.

Test plan

  • New definition test pins the separator-aware guard in the generated query text; the fix: fall back to base trace path when no rollover suffix (Linux) #1633 fallback test still passes unchanged.
  • Truth-tabled the exact CASE expression live against SQL 2022 across nine path shapes (Windows suffixed, Linux initial, Linux rolled, underscore-dir with and without suffix on both separator families, bare filenames): every legitimate strip still strips, both mangle cases now fall back to the base path.
  • Both affected test classes green locally: 20/20.

🤖 Generated with Claude Code

erikdarlingdata and others added 3 commits July 24, 2026 10:25
Follow-up to #1633: the _N rollover strip keyed on the LAST underscore
anywhere in the path, so a trace in an underscore-named directory with
an unsuffixed file was cut at the directory underscore
(/var/opt/my_sql/log/log.trc -> /var/opt/my.trc -> Msg 19049, no events
collected). An underscore now only counts as a rollover suffix when it
sits after the last path separator, both families, since the collector
runs against Windows and Linux targets. Applied to the shared collector
and install/29; truth-tabled live on SQL 2022 across nine path shapes.

Also carries the review follow-ups from the #1630/#1633 external PRs:

- CHANGELOG entries for #1630, #1633, and this fix.
- The three CPU comment sites now cite the actual ring-buffer fix
  (SQL Server 2025 CU1, KB5078298 fix 4796293) instead of implying
  2025 RTM, per MS Learn verification.
- The #1630 test's DoesNotContain guard normalizes line endings first,
  so it cannot pass vacuously on a CRLF checkout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@erikdarlingdata
erikdarlingdata merged commit 5c17afe into dev Jul 24, 2026
7 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/1636-trace-underscore-dir branch July 24, 2026 14:49
erikdarlingdata added a commit that referenced this pull request Jul 24, 2026
…section

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant