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

journal: Update group journal to accomudate rbd group #4687

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
journal: support removing multiple volumeID
Updating the code to support removing
multiple volumeID's mapping from the
group journal.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Jun 20, 2024
commit f60e70250bb856911d4e0bf193ee78bd28494805
2 changes: 1 addition & 1 deletion internal/cephfs/groupcontrollerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ func (cs *ControllerServer) deleteSnapshotsAndUndoReservation(ctx context.Contex
ctx,
vgo.MetadataPool,
vgsi.ReservedID,
volID)
[]string{volID})
j.Destroy()
if err != nil {
log.ErrorLog(ctx, "failed to remove volume snapshot mapping: %v", err)
Expand Down
14 changes: 7 additions & 7 deletions internal/journal/volumegroupjournal.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ type VolumeGroupJournal interface {
reservedUUID,
volumeID,
value string) error
// RemoveVolumeMapping removes a volumeID mapping from the UUID directory.
// RemoveVolumeMapping removes volumeIDs mapping from the UUID directory.
RemoveVolumeMapping(
ctx context.Context,
pool,
reservedUUID,
volumeID string) error
reservedUUID string,
volumeIDs []string) error
}

// VolumeGroupJournalConfig contains the configuration.
Expand Down Expand Up @@ -424,14 +424,14 @@ func (vgjc *VolumeGroupJournalConnection) AddVolumeMapping(
func (vgjc *VolumeGroupJournalConnection) RemoveVolumeMapping(
ctx context.Context,
pool,
reservedUUID,
volumeID string,
reservedUUID string,
volumeIDs []string,
) error {
err := removeMapKeys(ctx, vgjc.connection, pool, vgjc.config.namespace,
vgjc.config.cephUUIDDirectoryPrefix+reservedUUID,
[]string{volumeID})
volumeIDs)
if err != nil {
log.ErrorLog(ctx, "failed removing volume mapping from group: key %q: %v", volumeID, err)
log.ErrorLog(ctx, "failed removing volume mapping from group: key: %q %v", volumeIDs, err)

return err
}
Expand Down