Skip to content

Commit

Permalink
snapshot(ticdc): fix the data race when log set to debug caused by pr…
Browse files Browse the repository at this point in the history
…int logs (#11830) (#11835)

close #11827
  • Loading branch information
ti-chi-bot authored Dec 10, 2024
1 parent d9d1ae0 commit d8f0a6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cdc/entry/schema/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ func (s *Snapshot) SchemaCount() (count int) {

// DumpToString dumps the snapshot to a string.
func (s *Snapshot) DumpToString() string {
s.rwlock.RLock()
defer s.rwlock.RUnlock()

schemas := make([]string, 0, s.inner.schemas.Len())
s.IterSchemas(func(dbInfo *timodel.DBInfo) {
schemas = append(schemas, fmt.Sprintf("%v", dbInfo))
Expand Down

0 comments on commit d8f0a6e

Please sign in to comment.