Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
apps: revert the renumbering of enum in pendingop
Browse files Browse the repository at this point in the history
In PR #1702 we added a new OperationType and ChangeType. However, it
renumbered the enums. In cases where heketi is upgraded when the
db has pending ops, this can lead to undefined behavior.

Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
(cherry picked from commit 9c9c572)
  • Loading branch information
raghavendra-talur authored and phlogistonjohn committed Dec 15, 2020
1 parent cb8c78d commit 2c484a1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/glusterfs/pendingop.go
Expand Up @@ -28,23 +28,33 @@ import (
type PendingOperationType int

const (
// These values are persisted and we should never change the mapping. Even
// if an operation type is deprecated, use a new one and retire the number
// associated with it.

OperationUnknown PendingOperationType = iota
OperationCreateVolume
OperationDeleteVolume
OperationExpandVolume
OperationCreateBlockVolume
OperationDeleteBlockVolume
OperationExpandBlockVolume
OperationRemoveDevice
OperationCloneVolume
OperationBrickEvict
OperationExpandBlockVolume
// If you have any edit except directly above this line it is probably a
// mistake. Read the top comment about renumbering the enums.
)

// PendingChangeType identifies what kind of lower-level new item or change
// is being made to the system as part of a higher-level pending operation.
type PendingChangeType int

const (
// These values are persisted and we should never change the mapping. Even
// if a change type is deprecated, use a new one and retire the number
// associated with it.

OpUnknown PendingChangeType = iota
OpAddBrick
OpAddVolume
Expand All @@ -53,13 +63,15 @@ const (
OpExpandVolume
OpAddBlockVolume
OpDeleteBlockVolume
OpExpandBlockVolume
OpRemoveDevice
OpCloneVolume
OpSnapshotVolume
OpAddVolumeClone
OpChildOperation
OpParentOperation
OpExpandBlockVolume
// If you have any edit except directly above this line it is probably a
// mistake. Read the top comment about renumbering the enums.
)

// PendingOperationAction tracks individual changes to entries within the
Expand Down

0 comments on commit 2c484a1

Please sign in to comment.