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 5G buffer to space required for postgres upgrade #429

Merged
merged 1 commit into from
May 18, 2023

Conversation

lognaturel
Copy link
Member

@lognaturel lognaturel commented May 16, 2023

Closes #424

What has been done to verify that this works as intended?

On the dev server, I changed the line changed by this PR to

used="$(( $(du -s /var/lib/docker | cut -f1) + 5000000" )) # add 5G of buffer

There's about 11G of stuff in that folder and I confirmed that the script said I needed 17G for the update.

I don't have a good strategy for requesting the space check when the migration has already been done (and there's no postgres container). I think this is good enough but the reviewer should see whether they agree!

Why is this the best possible solution? Were any other approaches considered?

I considered telling the user we were adding a buffer or only adding it in the error message. But this is simple and feels like the most fool-proof.

The issue mentioned the possibility of 10Gb of buffer. That seemed extreme to me.

I'm not totally sure whether the arithmetic expansion is necessary (it worked for me without) but I figure it can't hurt.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Risk is isolated to space determination. It might be broken.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@lognaturel lognaturel changed the title Add buffer to space required for postgres upgrade Add 5G buffer to space required for postgres upgrade May 16, 2023
@matthew-white matthew-white linked an issue May 16, 2023 that may be closed by this pull request
Copy link
Contributor

@sadiqkhoja sadiqkhoja left a comment

Choose a reason for hiding this comment

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

Change is good to go.

However, I noticed the numbers are multiplied by 1000 instead of 1024 in the file

@lognaturel
Copy link
Member Author

@sadiqkhoja I briefly wondered about that. I think it ends up being unimportant because of all the rounding so I matched what was already there.

@lognaturel lognaturel merged commit ad48402 into getodk:next May 18, 2023
@lognaturel lognaturel deleted the space-buffer branch May 18, 2023 19:31
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.

Add some disk space margin to check-available-space
2 participants