Skip to content

Commit

Permalink
Fix format (selectdb#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter authored Dec 11, 2024
1 parent 44229b7 commit b99e82d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
9 changes: 1 addition & 8 deletions pkg/ccr/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -2580,19 +2580,12 @@ func (j *Job) handleRecoverInfo(binlog *festruct.TBinlog) error {
return j.handleRecoverInfoRecord(binlog.GetCommitSeq(), recoverInfo)
}

func isRecoverTable(recoverInfo *record.RecoverInfo) bool {
if recoverInfo.PartitionName == "" || recoverInfo.PartitionId == -1 {
return true
}
return false
}

func (j *Job) handleRecoverInfoRecord(commitSeq int64, recoverInfo *record.RecoverInfo) error {
if j.isBinlogCommitted(recoverInfo.TableId, commitSeq) {
return nil
}

if isRecoverTable(recoverInfo) {
if recoverInfo.IsRecoverTable() {
var tableName string
if recoverInfo.NewTableName != "" {
tableName = recoverInfo.NewTableName
Expand Down
7 changes: 7 additions & 0 deletions pkg/ccr/record/recover_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func NewRecoverInfoFromJson(data string) (*RecoverInfo, error) {
return &recoverInfo, nil
}

func (c *RecoverInfo) IsRecoverTable() bool {
if c.PartitionName == "" || c.PartitionId == -1 {
return true
}
return false
}

// String
func (c *RecoverInfo) String() string {
return fmt.Sprintf("RecoverInfo: DbId: %d, NewDbName: %s, TableId: %d, TableName: %s, NewTableName: %s, PartitionId: %d, PartitionName: %s, NewPartitionName: %s",
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/kitex_gen/frontendservice/FrontendService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b99e82d

Please sign in to comment.