Skip to content

Conversation

IgorBenko
Copy link
Contributor

Trello Ticket: https://trello.com/c/w6Pj1IpF/4549-look-into-this-selfhosted-issues-while-migration-if-this-is-something-we-need-to-fix

Redis has multiple ways of persisting data on FS: https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/
It can be a single .aof file or a combination of RDB+AOF. To ensure that we properly cleanup data for both cases, I left both commands in, but with the -f flag to ensure that there are no errors if either path doesn't exist.

NOTE: not sure about adding sudo. It was needed for these commands in my case. Should we leave that in or rather remove it and the user must figure that out?

Regarding the second issue in the Trello ticket, we can see that multiple pod names have been assigned to the UI_POD variable. I presume that other ones were just leftover pods of failed deployments. I added a filter to the command to ensure that only the running UI pod is assigned.

…e existing data before the import.

There might be ui pods that have failed. Ensure that only running one are used.
@IgorBenko IgorBenko requested a review from a team December 11, 2024 17:10
cp packagist_redis.rdb /var/openebs/local/$PV_NAME/dump.rdb
sudo rm -f /var/openebs/local/$PV_NAME/appendonly.aof
sudo rm -rf /var/openebs/local/$PV_NAME/appendonlydir
sudo cp packagist_redis.rdb /var/openebs/local/$PV_NAME/dump.rdb
Copy link
Member

Choose a reason for hiding this comment

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

If you need to cp this with sudo, can the Redis container still read the file or does this cause a permission issue?

Copy link
Member

Choose a reason for hiding this comment

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

If we decide to remove sudo from the example, then would at least mention that they might require sudo

Copy link
Contributor Author

@IgorBenko IgorBenko Dec 12, 2024

Choose a reason for hiding this comment

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

All the existing files were owned by root. Also the Redis process is running as root, so cp with sudo should not cause any issues at all. I also didn't have any issues when testing this.

As the users might set up this differently, it might make more sense to take sudo out and mention that in a comment.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@IgorBenko IgorBenko requested a review from glaubinix December 12, 2024 10:57
@IgorBenko IgorBenko merged commit dc6ecb6 into main Dec 12, 2024
@IgorBenko IgorBenko deleted the make-import-scripts-more-robust branch December 12, 2024 11: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