You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "mlycore (via GitHub)" <gi...@apache.org> on 2023/03/21 10:11:47 UTC

[GitHub] [shardingsphere-on-cloud] mlycore commented on a diff in pull request #268: feat(pitr): implement func backup

mlycore commented on code in PR #268:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/268#discussion_r1143119771


##########
pitr/cli/internal/cmd/backup.go:
##########
@@ -19,67 +19,345 @@ package cmd
 
 import (
 	"fmt"
+	"github.com/apache/shardingsphere-on-cloud/pitr/cli/internal/pkg"
+	"github.com/apache/shardingsphere-on-cloud/pitr/cli/internal/pkg/model"
+	"github.com/apache/shardingsphere-on-cloud/pitr/cli/internal/pkg/xerr"
+	"github.com/google/uuid"
+	"os"
+	"sync"
+	"time"
 
 	"github.com/spf13/cobra"
 
 	"github.com/apache/shardingsphere-on-cloud/pitr/cli/pkg/logging"
 )
 
 const (
-	dnBackupPath = "dn-backup-path"
-	dnThreadsNum = "dn-threads-num"
+	dnBackupPath                = "dn-backup-path"
+	dnThreadsNum                = "dn-threads-num"
+	defaultInstance             = "ins-default-ss"
+	defaultShowDetailRetryTimes = 3 // retry times of check backup detail from agent server

Review Comment:
   Please move the comments on top of the code.



##########
pitr/agent/internal/cons/backup.go:
##########
@@ -0,0 +1,34 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package cons
+
+const (
+	DBBackModeFull   = "FULL"
+	DBBackModePTrack = "PTRACK"
+
+	// opengauss backup status
+	OGBackupStatusOk      = "OK"
+	OGBackupStatusError   = "ERROR"
+	OGBackupStatusRunning = "RUNNING"
+
+	// agent backup status
+	DBBackupStatusCompleted = "Completed"
+	DBBackupStatusFailed    = "Failed"
+	DBBackupStatusRunning   = "Running"
+	DBBackupStatusOther     = "Other"

Review Comment:
   What do you expect users to do when he meet this `Other` status ?



##########
pitr/agent/internal/cons/backup.go:
##########
@@ -0,0 +1,34 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package cons
+
+const (
+	DBBackModeFull   = "FULL"
+	DBBackModePTrack = "PTRACK"
+
+	// opengauss backup status
+	OGBackupStatusOk      = "OK"
+	OGBackupStatusError   = "ERROR"
+	OGBackupStatusRunning = "RUNNING"
+
+	// agent backup status
+	DBBackupStatusCompleted = "Completed"
+	DBBackupStatusFailed    = "Failed"
+	DBBackupStatusRunning   = "Running"
+	DBBackupStatusOther     = "Other"

Review Comment:
   What is the possible status that `Other` implies ? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org