Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structlogging: reorganize hot range logger for testability #142995

Open
angles-n-daemons opened this issue Mar 17, 2025 · 0 comments · Fixed by #142996
Open

structlogging: reorganize hot range logger for testability #142995

angles-n-daemons opened this issue Mar 17, 2025 · 0 comments · Fixed by #142996
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-observability

Comments

@angles-n-daemons
Copy link
Contributor

angles-n-daemons commented Mar 17, 2025

Right now the hot range logger is bundled into a single running block. Introduce utility functions shouldLog and logHotRanges so that the tests can be run more easily.

Also introduce functionality to trigger logging without having to wait for a timer.

Epic: CRDB-43150

Jira issue: CRDB-48619

@angles-n-daemons angles-n-daemons added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Mar 17, 2025
@angles-n-daemons angles-n-daemons self-assigned this Mar 17, 2025
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 17, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.

Fixes: cockroachdb#142995
Epic: CRDB-43150
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 17, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 19, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 19, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 19, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150

Release note: None
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 20, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150

Release note: None
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 20, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150

Release note: None
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 21, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150

Release note: None
angles-n-daemons added a commit to angles-n-daemons/cockroach that referenced this issue Mar 26, 2025
This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: cockroachdb#142995
Epic: CRDB-43150

Release note: None
craig bot pushed a commit that referenced this issue Mar 26, 2025
142996: structlogging: restructure hot range logger for testability r=angles-n-daemons a=angles-n-daemons

structlogging: restructure hot range logger for testability

This change does a few things to improve the testability of the hot
ranges logger. The includes:

__Logger__:
 * The introduction of a shouldLog function, which determines whether
         the system should log or not.
 * The breakout of the logging action into its own function.

__Tests__:
 * The addition of a setup and teardown utility for the hot ranage
         logger.
 * The breakout of the default case and a timed case.
 * Tests for hot ranges which exist in the system to start.

Fixes: #142995
Epic: CRDB-43150


143467: changefeedccl: update TestChangefeedLaggingSpanCheckpointing r=aerfrei,asg0451 a=andyyang890

This patch updates `TestChangefeedLaggingSpanCheckpointing` to ensure
we checkpoint spans at at least two different timestamps.

This patch also fixes the issue where the `OnRangeFeedStart` kvfeed
testing knob was not being invoked in production code.

Informs #137692
Fixes #143377

Release note: None

Co-authored-by: Brian Dillmann <[email protected]>
Co-authored-by: Andy Yang <[email protected]>
@craig craig bot closed this as completed in d13ad97 Mar 26, 2025
@exalate-issue-sync exalate-issue-sync bot reopened this Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-observability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant