Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix drive name of volume at startup if needed #873

Merged

Conversation

Praveenrajmani
Copy link
Collaborator

When a node-server starts, it syncs the drive states like drive name, capacity, make etc. This is because, the drive order wouldv'e changed during node restarts.

In such scenarios, We need to also make sure to fix the drive name in corresponding volumes. Without this fix, the kubectl directpv list volumes command will show wrong drive names (if the node has restarted)

@Praveenrajmani
Copy link
Collaborator Author

I need to test this on real machines before merging

@Praveenrajmani Praveenrajmani marked this pull request as draft October 18, 2023 12:35
@Praveenrajmani Praveenrajmani marked this pull request as ready for review October 24, 2023 06:57
@Praveenrajmani Praveenrajmani force-pushed the sync_drive_names_in_volumes branch 2 times, most recently from 16e63a7 to 3b1ae6d Compare October 24, 2023 16:21
@Praveenrajmani Praveenrajmani force-pushed the sync_drive_names_in_volumes branch from 3b1ae6d to 01ff2d8 Compare October 25, 2023 08:43
volume := object.(*types.Volume)
if !volume.GetDeletionTimestamp().IsZero() {
return handler.delete(ctx, volume)
}

if eventType == controller.AddEvent {
Copy link
Member

Choose a reason for hiding this comment

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

For existing volumes, Add event occurs only at start of the controller. This is same as added into Sync(). As volumes live for very long, we could add drive name update every day once in future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you want to keep this in Update event handler? The reason i added this in Add event handler is because, this can happen only during the node restarts mostly.

Adding this in Update handler, makes these repeated GET calls to the respective drive objects.

If the drive order can change at runtime (considering it as a rare event), can we suggest them to restart the pods instead of checking everytimea at the update handler?

Copy link
Member

Choose a reason for hiding this comment

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

Yep. We will add it later.

When a node-server starts, it syncs the drive states like drive name,
capacity, make etc. This is because, the drive order wouldv'e changed
during node restarts.

In such scenarios, We need to also make sure to fix the drive name in
corresponding volumes. Without this fix, the `kubectl directpv list volumes`
command will show wrong drive names (if the node has restarted)
@Praveenrajmani Praveenrajmani force-pushed the sync_drive_names_in_volumes branch from 01ff2d8 to 0a11728 Compare October 27, 2023 07:02
@balamurugana balamurugana changed the title Fix the drive name in respective volumes while syncing fix drive name of volume at startup if needed Oct 27, 2023
@Praveenrajmani Praveenrajmani merged commit 30dc068 into minio:master Oct 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants