Skip to content

Commit

Permalink
chore(restore): remove EngineBackupRestoreFinish
Browse files Browse the repository at this point in the history
longhorn/longhorn-6613

Signed-off-by: Chin-Ya Huang <[email protected]>
  • Loading branch information
c3y1huang authored and derekbit committed Aug 27, 2024
1 parent b08d561 commit a08eedd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions protobuf/imrpc/proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ service ProxyEngineService {
rpc SnapshotBackupStatus(EngineSnapshotBackupStatusRequest) returns (EngineSnapshotBackupStatusProxyResponse);
rpc BackupRestore(EngineBackupRestoreRequest) returns (EngineBackupRestoreProxyResponse);
rpc BackupRestoreStatus(ProxyEngineRequest) returns (EngineBackupRestoreStatusProxyResponse);
rpc BackupRestoreFinish(EngineBackupRestoreFinishRequest) returns (google.protobuf.Empty);
rpc CleanupBackupMountPoints(google.protobuf.Empty) returns (google.protobuf.Empty);

rpc ReplicaAdd(EngineReplicaAddRequest) returns (google.protobuf.Empty);
Expand Down Expand Up @@ -230,10 +229,6 @@ message EngineBackupRestoreStatus {
string backup_url = 8;
}

message EngineBackupRestoreFinishRequest {
ProxyEngineRequest proxy_engine_request = 1;
}

message EngineReplicaAddRequest {
ProxyEngineRequest proxy_engine_request = 1;

Expand Down
5 changes: 0 additions & 5 deletions protobuf/spdkrpc/spdk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ service SPDKService {
rpc EngineBackupCreate(BackupCreateRequest) returns (BackupCreateResponse) {}
rpc EngineBackupStatus(BackupStatusRequest) returns (BackupStatusResponse) {}
rpc EngineBackupRestore(EngineBackupRestoreRequest) returns (EngineBackupRestoreResponse) {}
rpc EngineBackupRestoreFinish(EngineBackupRestoreFinishRequest) returns (google.protobuf.Empty) {}
rpc EngineRestoreStatus(RestoreStatusRequest) returns (RestoreStatusResponse) {}

rpc DiskCreate(DiskCreateRequest) returns (Disk);
Expand Down Expand Up @@ -387,10 +386,6 @@ message EngineBackupRestoreResponse {
map<string, string> errors = 4;
}

message EngineBackupRestoreFinishRequest {
string engine_name = 1;
}

message ReplicaBackupRestoreRequest {
string backup_url = 1;
string replica_name = 2;
Expand Down

2 comments on commit a08eedd

@innobead
Copy link
Member

Choose a reason for hiding this comment

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

We must avoid removing existing methods, messages, fields, or enums to maintain backward compatibility with the proto contracts: an anti-case for this case, longhorn/longhorn-manager#3145 (comment).

Let's remove the corresponding code from v1.7.x codebase to fix that issue.

/pkg/client/proxy_backup.go#L185-L213

func (c *ProxyClient) BackupRestoreFinish(dataEngine, engineName, volumeName, serviceAddress string) error {
	input := map[string]string{
		"engineName":     engineName,
		"volumeName":     volumeName,
		"serviceAddress": serviceAddress,
	}
	if err := validateProxyMethodParameters(input); err != nil {
		return errors.Wrap(err, "failed to finishing backup restoration")
	}

	driver, ok := rpc.DataEngine_value[getDataEngine(dataEngine)]
	if !ok {
		return fmt.Errorf("failed to finishing backup restoration: invalid data engine %v", dataEngine)
	}

	req := &rpc.EngineBackupRestoreFinishRequest{
		ProxyEngineRequest: &rpc.ProxyEngineRequest{
			Address:    serviceAddress,
			EngineName: engineName,
			// nolint:all replaced with DataEngine
			BackendStoreDriver: rpc.BackendStoreDriver(driver),
			DataEngine:         rpc.DataEngine(driver),
			// This is the name we will use for validation when communicating with the restoring engine.
			VolumeName: volumeName,
		},
	}
	_, err := c.service.BackupRestoreFinish(getContextWithGRPCTimeout(c.ctx), req)
	return err
}

cc @derekbit

@c3y1huang
Copy link
Contributor Author

@c3y1huang c3y1huang commented on a08eedd Sep 25, 2024

Choose a reason for hiding this comment

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

Let's remove the corresponding code from v1.7.x codebase to fix that issue.

Or we could revert the changes.
#29

Please sign in to comment.