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

add RawKV GC metric versions count #12523

Merged
merged 5 commits into from May 16, 2022

Conversation

ystaticy
Copy link
Contributor

@ystaticy ystaticy commented May 16, 2022

Signed-off-by: ystaticy y_static_y@sina.com

What is changed and how it works?

Issue Number: Ref #12535

What's Changed:

Fix RawKV Compaction filter report total is aways 0

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Test steps as follows:

  1. To set api version in tikv.toml as follows:
    enable-ttl = true
    api-version = 2
  2. start tikv cluster.
  3. write data until trigger compaction.
  4. Observation log output total value is not always 0.

Signed-off-by: ystaticy <y_static_y@sina.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 16, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • MyonKeminta
  • pingyu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@@ -196,6 +196,8 @@ impl RawCompactionFilter {
if commit_ts.into_inner() >= self.safe_point {
return Ok(CompactionFilterDecision::Keep);
}

self.versions += 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should only entries with !raw_value.is_valid() be counted ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In txn gc of compaction_filter.rs records will self.versions += 1;,
which is not match commit_ts > self.safe_point || value_type != CompactionFilterValueType::Value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versions means: Total stale versions meet by compaction filters.
It is defined in CompactionFilterStats

pub struct CompactionFilterStats {
    pub versions: Cell<usize>, // Total stale versions meet by compaction filters.
    pub filtered: Cell<usize>, // Filtered versions by compaction filters.
    pub last_report: Cell<Instant>,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get ~

@ystaticy
Copy link
Contributor Author

/run-test

1 similar comment
@ystaticy
Copy link
Contributor Author

/run-test

Copy link
Contributor

@pingyu pingyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label May 16, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels May 16, 2022
@ystaticy
Copy link
Contributor Author

/run-test

1 similar comment
@ystaticy
Copy link
Contributor Author

/run-test

@ystaticy
Copy link
Contributor Author

/run-test

1 similar comment
@ystaticy
Copy link
Contributor Author

/run-test

@iosmanthus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@iosmanthus: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: ef23ecf

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label May 16, 2022
@ystaticy
Copy link
Contributor Author

/run-test

@ti-chi-bot
Copy link
Member

@ystaticy: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit b622012 into tikv:master May 16, 2022
fengou1 pushed a commit to fengou1/tikv that referenced this pull request May 26, 2022
ref tikv#12535

Signed-off-by: ystaticy <y_static_y@sina.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Type: PR - From contributors release-note size/XS status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants