Skip to content

fix(core): make WAL apply lag metrics persistent across restarts#6017

Merged
bluestreak01 merged 11 commits intomasterfrom
mt_txn-counter-init
Aug 4, 2025
Merged

fix(core): make WAL apply lag metrics persistent across restarts#6017
bluestreak01 merged 11 commits intomasterfrom
mt_txn-counter-init

Conversation

@mtopolnik
Copy link
Copy Markdown
Contributor

Fixes #6001.

@mtopolnik mtopolnik requested a review from ideoma August 1, 2025 12:30
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 1, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mt_txn-counter-init

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ideoma
Copy link
Copy Markdown
Collaborator

ideoma commented Aug 4, 2025

@coderabbitai review please

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 4, 2025

🧩 Analysis chain

I'll review the changes for making WAL apply lag metrics persistent across restarts. Let me examine the code changes first.


🏁 Script executed:

#!/bin/bash
# Get the PR diff to understand what changes were made
git diff HEAD~1..HEAD

# Also get the full content of the modified files to understand the context
echo "=== SeqTxnTracker.java ==="
cat io/questdb/cairo/wal/seq/SeqTxnTracker.java

echo "=== WalMetrics.java ==="
cat io/questdb/cairo/wal/WalMetrics.java

echo "=== TableSequencerAPI.java ==="
cat io/questdb/cairo/wal/seq/TableSequencerAPI.java

Length of output: 779


Let me explore the repository structure to find the correct file paths and examine the changes.


🏁 Script executed:

#!/bin/bash
# First, let's see the repository structure
echo "=== Repository root contents ==="
ls -la

# Find all Java files related to WAL or metrics
echo "=== Finding WAL and metrics related files ==="
fd -e java | grep -i wal
fd -e java | grep -i metric

# Look for the specific files mentioned in the coverage report
echo "=== Searching for SeqTxnTracker ==="
fd "SeqTxnTracker.java"

echo "=== Searching for WalMetrics ==="
fd "WalMetrics.java"

echo "=== Searching for TableSequencerAPI ==="
fd "TableSequencerAPI.java"

# Get recent commits to understand the changes
echo "=== Recent commits ==="
git log --oneline -10

Length of output: 11941


Now let me examine the actual files and get the recent changes:


🏁 Script executed:

#!/bin/bash
# Get the actual content of the modified files
echo "=== SeqTxnTracker.java ==="
cat core/src/main/java/io/questdb/cairo/wal/seq/SeqTxnTracker.java

echo -e "\n=== WalMetrics.java ==="
cat core/src/main/java/io/questdb/cairo/wal/WalMetrics.java

echo -e "\n=== TableSequencerAPI.java ==="
cat core/src/main/java/io/questdb/cairo/wal/seq/TableSequencerAPI.java

# Get recent git commits to understand the changes
echo -e "\n=== Recent commits (last 5) ==="
git log --oneline -5

# Try to get the diff using git show for the latest commit
echo -e "\n=== Latest commit changes ==="
git show --name-only HEAD

Length of output: 279773


Let me examine the specific changes made in this PR:


🏁 Script executed:

#!/bin/bash
# Get the latest commit changes
echo "=== Latest commit changes ==="
git show HEAD --name-only

echo -e "\n=== Full diff for latest commit ==="
git show HEAD

# Also try to see if there are any other recent commits related to WAL metrics
echo -e "\n=== Recent commits mentioning WAL or metrics ==="
git log --oneline -20 | grep -i -E "(wal|metric)"

Length of output: 303250


@ideoma: The changes ensure WAL apply lag metrics are now tracked and updated persistently across restarts, using the metrics infrastructure in a systematic way. The implementation is clean, aligns with the PR objective, and is well-covered by tests. No issues found—approved.

✅ Actions performed

Comments resolved.

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 17 / 19 (89.47%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/wal/seq/SeqTxnTracker.java 10 12 83.33%
🔵 io/questdb/cairo/wal/WalMetrics.java 6 6 100.00%
🔵 io/questdb/cairo/wal/seq/TableSequencerAPI.java 1 1 100.00%

@bluestreak01 bluestreak01 merged commit 829e5a4 into master Aug 4, 2025
35 checks passed
@bluestreak01 bluestreak01 deleted the mt_txn-counter-init branch August 4, 2025 15:00
nwoolmer pushed a commit to questdb/documentation that referenced this pull request Aug 12, 2025
PR questdb/questdb#6017 changes these names,
this is a followup.
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.

Metric questdb_wal_apply_seq_txn_total shows unstable values on restart

4 participants