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

Clarify swap descriptions #14480

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

hfxsd
Copy link
Collaborator

@hfxsd hfxsd commented Aug 10, 2023

What is changed, added or deleted? (Required)

Clarify confusing descriptions for disabling system swap

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v7.3 (TiDB 7.3 versions)
  • v7.2 (TiDB 7.2 versions)
  • v7.1 (TiDB 7.1 versions)
  • v7.0 (TiDB 7.0 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@hfxsd hfxsd self-assigned this Aug 10, 2023
@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 10, 2023
@hfxsd hfxsd requested review from bb7133 and lilin90 August 10, 2023 00:32
@hfxsd hfxsd added needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.2 translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. and removed missing-translation-status This PR does not have translation status info. labels Aug 10, 2023
@hfxsd
Copy link
Collaborator Author

hfxsd commented Aug 10, 2023

/verify

Copy link
Member

@bb7133 bb7133 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
Copy link

ti-chi-bot bot commented Aug 10, 2023

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

In response to this:

LGTM

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/test-infra repository.

Copy link
Contributor

@dveeden dveeden left a comment

Choose a reason for hiding this comment

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

Could we configure this on a per-process basis? e.g. MemorySwapMax in systemd unit specifications? This might allow TiDB to not swap out but allow other things to be swapped out.

check-before-deployment.md Outdated Show resolved Hide resolved
> - `sysctl -p` is to make the configuration effective without restarting the system.
```bash
echo "vm.swappiness = 0">> /etc/sysctl.conf
swapoff -a
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not sufficient. The swapoff -a command only disables the swap until the next reboot of the system. One also needs to remove this from /etc/fstab of mask the systemd unit for swap.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bb7133 PTAL

Copy link
Contributor

Choose a reason for hiding this comment

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

https://rageagainstshell.com/2019/12/disable-swap-in-systemd/ has a good description for systemd based systems

Copy link
Contributor

Choose a reason for hiding this comment

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

For now I would suggest to keep it closer to the original statement:

echo "vm.swappiness = 0">> /etc/sysctl.conf
sysctl -p
swapoff -a && swapon -a

This sets swappiness to 0 and then disables/enables swap to for things that have already been swapped out to be swapped back in.

If we leave swap disabled, but don't configure this in a way that survives a reboot this is like leaving a booby trap.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 10, 2023
@qiancai
Copy link
Collaborator

qiancai commented Oct 20, 2023

Removed the needs-cherry-pick-release-7.2 label because the v7.2 docs have been archived at https://docs-archive.pingcap.com/tidb/v7.2 and will no longer receive new updates.

@qiancai
Copy link
Collaborator

qiancai commented Feb 2, 2024

Removed the needs-cherry-pick-release-7.3 label because the v7.3 docs have been archived at https://docs-archive.pingcap.com/tidb/v7.3 and will no longer receive new updates.

check-before-deployment.md Outdated Show resolved Hide resolved
Co-authored-by: Daniël van Eeden <github@myname.nl>
@hfxsd hfxsd added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Jan 7, 2025
Copy link
Member

@lilin90 lilin90 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 bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 7, 2025
Copy link

ti-chi-bot bot commented Jan 7, 2025

[LGTM Timeline notifier]

Timeline:

  • 2023-08-10 06:50:38.130893406 +0000 UTC m=+181802.679909378: ☑️ agreed by dveeden.
  • 2025-01-07 09:26:52.986759211 +0000 UTC m=+259356.275590918: ☑️ agreed by lilin90.

@hfxsd
Copy link
Collaborator Author

hfxsd commented Jan 7, 2025

/approve

Copy link

ti-chi-bot bot commented Jan 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hfxsd

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 7, 2025
@ti-chi-bot ti-chi-bot bot merged commit ba5cbad into pingcap:master Jan 7, 2025
8 of 9 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #19921.

@ti-chi-bot ti-chi-bot mentioned this pull request Jan 7, 2025
16 tasks
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #19922.

@ti-chi-bot ti-chi-bot mentioned this pull request Jan 7, 2025
16 tasks
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #19923.

@ti-chi-bot ti-chi-bot mentioned this pull request Jan 7, 2025
16 tasks
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #19924.

@ti-chi-bot ti-chi-bot mentioned this pull request Jan 7, 2025
16 tasks
ti-chi-bot bot pushed a commit that referenced this pull request Jan 7, 2025
ti-chi-bot bot pushed a commit that referenced this pull request Jan 7, 2025
ti-chi-bot bot pushed a commit that referenced this pull request Jan 7, 2025
ti-chi-bot bot pushed a commit that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants