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

log-backup: added manual flush RPCs #18027

Merged
merged 15 commits into from
Jan 8, 2025
Merged

Conversation

YuJuncen
Copy link
Contributor

What is changed and how it works?

Issue Number: Close #18026

What's Changed:

Added a new RPC endpoint `flush_now` for the service `LogBackup`.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 18, 2024
@YuJuncen
Copy link
Contributor Author

/test pull-unit-test

YuJuncen and others added 7 commits December 20, 2024 14:39
Signed-off-by: hillium <yujuncen@pingcap.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
@@ -857,20 +865,36 @@ where
}
}

pub fn on_force_flush(&self, task: String) {
pub fn on_force_flush(&self, task: TaskSelectorRef<'_>, sender: Sender<FlushResult>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to prevent too much force flush here if the callers abuse it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now we don't need to care this. Because only 1 task is allowed.

}),
min_ts: mts,
})
.await
})
}

fn on_exec_flush(&mut self, task: String, resolved: ResolvedRegions) {
fn on_exec_flush(&mut self, task: String, resolved: ResolvedRegions, cb: Sender<FlushResult>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

where can we know there is force flush occurs? from tikv log or metrics?

Copy link
Contributor Author

@YuJuncen YuJuncen Dec 25, 2024

Choose a reason for hiding this comment

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

For now we can get the number of ForceFlush tasks by the metric tikv_log_backup_interal_actor_acting_duration_sec_count.

}
})));
let fut = self.do_flush(task.clone(), resolved);
let syncer = self.checkpoint_mgr.make_syncer();
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can make syncer in the on_force_flush to avoid the normal flush execution path.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 30, 2024

@BornChanger: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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 kubernetes-sigs/prow repository.

Signed-off-by: hillium <yu745514916@live.com>
Signed-off-by: hillium <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 6, 2025
Signed-off-by: hillium <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 6, 2025
Signed-off-by: hillium <yu745514916@live.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 6, 2025
Signed-off-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Jan 7, 2025

/test pull-unit-test

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 7, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 7, 2025

[LGTM Timeline notifier]

Timeline:

  • 2024-12-27 04:01:03.309131674 +0000 UTC m=+63798.665136195: ☑️ agreed by Leavrth.
  • 2025-01-07 10:19:03.8691087 +0000 UTC m=+262487.157940406: ☑️ agreed by 3pointer.

Copy link
Contributor

ti-chi-bot bot commented Jan 7, 2025

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

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 bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 8, 2025
Signed-off-by: hillium <yu745514916@live.com>
Copy link
Contributor

ti-chi-bot bot commented Jan 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, BornChanger, iosmanthus, Leavrth

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jan 8, 2025
@ti-chi-bot ti-chi-bot bot merged commit 222019f into tikv:master Jan 8, 2025
8 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log-backup: add a RPC endpoint to force flush tasks
5 participants