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

scylla_swap_setup: run error check before allocating swap and increase swap allocation speed #12668

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

syuu1228
Copy link
Contributor

@syuu1228 syuu1228 commented Jan 30, 2023

This patch fixes error check and speed up swap allocation.

Following patches are included:

  • scylla_swap_setup: run error check before allocating swap
    avoid create swapfile before running error check
  • scylla_swap_setup: use fallocate on ext4
    this inclease swap allocation speed on ext4

@scylladb-promoter
Copy link
Contributor

@syuu1228
Copy link
Contributor Author

I changed my mind, --overwrite-unit-file is too Azure (or cloud) specific feature, not related with on-premise users.
I think it's better to handle in scylla-machine-image, not here.
I will rebase this patchset without scylla_swap_setup: allow overwrite systemd unit file.

We should run error check before running dd, otherwise it will left
swapfile on disk without completing swap setup.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
We stop using fallocate for allocating swap since it does not work on
xfs (scylladb#6650).
However, dd is much slower than fallocate since it filling data on the
file, let's use fallocate when filesystem is ext4 since it actually
works and faster.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
@syuu1228 syuu1228 changed the title scylla_swap_setup: azure swap support and increase swap allocation speed scylla_swap_setup: run error check before allocating swap and increase swap allocation speed Jan 31, 2023
@syuu1228
Copy link
Contributor Author

Rebased, dropped scylla_swap_setup: allow overwrite systemd unit file.

@scylladb-promoter
Copy link
Contributor

@scylladb-promoter
Copy link
Contributor

@syuu1228
Copy link
Contributor Author

ping

@syuu1228
Copy link
Contributor Author

syuu1228 commented Oct 7, 2023

@avikivity ping

@syuu1228
Copy link
Contributor Author

syuu1228 commented Dec 6, 2023

@avikivity ping, we want this for Azure machine-image

@avikivity avikivity merged commit 92d61de into scylladb:next Dec 6, 2023

swapunit_bn = out('systemd-escape -p --suffix=swap {}'.format(swapfile))
swapunit = Path('/etc/systemd/system/{}'.format(swapunit_bn))
if not args.overwrite_unit_file and swapunit.exists():
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no overwrite_unit_file arg

@benipeled
Copy link
Contributor

@avikivity please dequeue (It fails scylla installation - #16331)

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.

None yet

4 participants