Skip to content

Commit

Permalink
update according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzx2001 committed Apr 12, 2024
1 parent 55f9f1f commit dafc626
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
9 changes: 2 additions & 7 deletions br/OWNERS
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
filters:
"(tidb-lightning\\.toml)$":
approvers:
- sig-critical-approvers-tidb-lightning
".*":
approvers:
- sig-approvers-br
approvers:
- sig-approvers-br
4 changes: 1 addition & 3 deletions pkg/lightning/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1378,12 +1378,10 @@ func (c *Conflict) adjust(i *TikvImporter) error {

if c.Threshold < 0 {
switch c.Strategy {
case ErrorOnDup:
case ErrorOnDup, NoneOnDup:
c.Threshold = 0
case IgnoreOnDup, ReplaceOnDup:
c.Threshold = DefaultRecordDuplicateThreshold
case NoneOnDup:
c.Threshold = 0
}
}
if c.Threshold > 0 && c.Strategy == ErrorOnDup {
Expand Down
6 changes: 3 additions & 3 deletions pkg/lightning/errormanager/errormanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const (
`

createConflictView = `
CREATE OR REPLACE VIEW %s.` + ConflictViewName + `
CREATE OR REPLACE VIEW %s.` + ConflictViewName + `
AS SELECT 0 AS is_precheck_conflict, task_id, create_time, table_name, index_name, key_data, row_data,
raw_key, raw_value, raw_handle, raw_row, is_data_kv, NULL AS path, NULL AS offset, NULL AS error, NULL AS row_id
FROM %s.` + ConflictErrorTableName + `
Expand Down Expand Up @@ -281,9 +281,9 @@ func (em *ErrorManager) Init(ctx context.Context) error {
}
}

// TODO: return VIEW to users regardless of the lightning configuration
if em.conflictV1Enabled && em.conflictV2Enabled {
sql := [2]string{"create conflict view", createConflictView}
err := exec.Exec(ctx, sql[0], strings.TrimSpace(common.SprintfWithIdentifiers(sql[1], em.schema, em.schema, em.schema)))
err := exec.Exec(ctx, "create conflict view", strings.TrimSpace(common.SprintfWithIdentifiers(createConflictView, em.schema, em.schema, em.schema)))
if err != nil {
return err
}
Expand Down

0 comments on commit dafc626

Please sign in to comment.