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

chore: Enable external configuration of DB storage size retention policy #77

Merged

Conversation

NagyZoltanPeter
Copy link
Contributor

Add STORAGE_SIZE config to enable storage size retention externally, deafult to 1GB

We think regular users may not accept several / dozens of GB databases created on their disks while try waku node via nwaku-compose.
With the new better managed Postgress db size retention mechanism it is better to set some lower DB size limit by default (1GB) which still allows several hours of messages to be stored and yet allow operator / testers to set allowed DB size to their needs.

This command can be used with this PR:

STORAGE_SIZE=1500MB docker compose up -d

Copy link

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

Thanks!

run_node.sh Outdated
Comment on lines 59 to 62
if [[ ! "${STORAGE_SIZE}" =~ ^[0-9]*\.?[0-9]+[MG]B$ ]]; then
echo "Invalid STORAGE_SIZE value: \"${STORAGE_SIZE}\". Please use a valid size format (e.g. 1GB, 120MB, 1.5GB)."
exit 1
fi
Copy link

Choose a reason for hiding this comment

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

Do we really need this if the node already spit an error with a wrong format as input?

It's more user friendly this way I guess...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I saw just this: waku-org/nwaku#2532
So I will remove this to allow to be checked in one place... more future proof you're right.
The user either case needs to check the logs ....

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

@NagyZoltanPeter
Copy link
Contributor Author

Thank you!

We should probably also add this variable to https://github.com/waku-org/nwaku-compose/blob/master/.env.example and https://github.com/waku-org/nwaku-compose/blob/master/ADVANCED.md

Thank you for draw attention on it. I added the description and .env placeholder.

@NagyZoltanPeter NagyZoltanPeter merged commit 89afff4 into master Mar 14, 2024
@NagyZoltanPeter NagyZoltanPeter deleted the chore-enable-configurable-store-retention-size branch March 14, 2024 09:05
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.

3 participants