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

fix: add bucket status to bucket migration related events #621

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions proto/greenfield/storage/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ message EventMigrationBucket {
];
// The id of the destination primary sp
uint32 dst_primary_sp_id = 4;
// status define the status of the bucket.
BucketStatus status = 5;
}

message EventCancelMigrationBucket {
Expand All @@ -528,6 +530,8 @@ message EventCancelMigrationBucket {
(gogoproto.customtype) = "Uint",
(gogoproto.nullable) = false
];
// status define the status of the bucket.
BucketStatus status = 4;
}

message EventRejectMigrateBucket {
Expand All @@ -541,6 +545,8 @@ message EventRejectMigrateBucket {
(gogoproto.customtype) = "Uint",
(gogoproto.nullable) = false
];
// status define the status of the bucket.
BucketStatus status = 4;
}

message EventCompleteMigrationBucket {
Expand All @@ -559,6 +565,8 @@ message EventCompleteMigrationBucket {
uint32 global_virtual_group_family_id = 4;
// The src_primary_sp_id defines the primary sp id of the bucket before migrate.
uint32 src_primary_sp_id = 5;
// status define the status of the bucket.
BucketStatus status = 6;
}

message EventSetTag {
Expand Down
5 changes: 5 additions & 0 deletions x/storage/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"

"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
Expand Down Expand Up @@ -2182,6 +2183,7 @@ func (k Keeper) MigrateBucket(ctx sdk.Context, operator sdk.AccAddress, bucketNa
BucketName: bucketName,
BucketId: bucketInfo.Id,
DstPrimarySpId: dstSP.Id,
Status: bucketInfo.BucketStatus,
}); err != nil {
return err
}
Expand Down Expand Up @@ -2264,6 +2266,7 @@ func (k Keeper) CompleteMigrateBucket(ctx sdk.Context, operator sdk.AccAddress,
BucketId: bucketInfo.Id,
GlobalVirtualGroupFamilyId: gvgFamilyID,
SrcPrimarySpId: srcGvgFamily.PrimarySpId,
Status: bucketInfo.BucketStatus,
}); err != nil {
return err
}
Expand Down Expand Up @@ -2310,6 +2313,7 @@ func (k Keeper) CancelBucketMigration(ctx sdk.Context, operator sdk.AccAddress,
Operator: operator.String(),
BucketName: bucketName,
BucketId: bucketInfo.Id,
Status: bucketInfo.BucketStatus,
}); err != nil {
return err
}
Expand Down Expand Up @@ -2344,6 +2348,7 @@ func (k Keeper) RejectBucketMigration(ctx sdk.Context, operator sdk.AccAddress,
Operator: operator.String(),
BucketName: bucketName,
BucketId: bucketInfo.Id,
Status: bucketInfo.BucketStatus,
}); err != nil {
return err
}
Expand Down
Loading
Loading