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

after log restore, there are many warning logs #43402

Closed
Leavrth opened this issue Apr 25, 2023 · 0 comments · Fixed by #43416
Closed

after log restore, there are many warning logs #43402

Leavrth opened this issue Apr 25, 2023 · 0 comments · Fixed by #43416
Labels
affects-7.1 component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@Leavrth
Copy link
Contributor

Leavrth commented Apr 25, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. run log restore

2. What did you expect to see? (Required)

not many warning logs

3. What did you see instead (Required)

many warning logs

4. What is your TiDB version? (Required)

master

In the process of log restore, it would increase global schema version by 128 to trigger domain update.

tidb/br/pkg/restore/client.go

Lines 2852 to 2869 in 451bda4

func (rc *Client) UpdateSchemaVersion(ctx context.Context) error {
storage := rc.GetDomain().Store()
var schemaVersion int64
ctx = kv.WithInternalSourceType(ctx, kv.InternalTxnBR)
if err := kv.RunInNewTxn(
ctx,
storage,
true,
func(ctx context.Context, txn kv.Transaction) error {
t := meta.NewMeta(txn)
var e error
schemaVersion, e = t.GenSchemaVersions(128)
return e
},
); err != nil {
return errors.Trace(err)
}

it needs to increase it by 100+ in order to trigger full-reload, instead of diff-reload.

tidb/domain/domain.go

Lines 233 to 235 in 451bda4

if currentSchemaVersion != 0 && neededSchemaVersion > currentSchemaVersion && neededSchemaVersion-currentSchemaVersion < 100 {
is, relatedChanges, err := do.tryLoadSchemaDiffs(m, currentSchemaVersion, neededSchemaVersion)
if err == nil {

However, once we increase the schema version without any Diff: key, it would print warning log every time the domain reloads.

tidb/domain/domain.go

Lines 288 to 291 in 451bda4

if data == nil || data.Info == nil || len(data.Info.Writes) == 0 {
return 0, errors.Errorf("There is no Write MVCC info for the schema version")
}
return int64(data.Info.Writes[0].CommitTs), nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant