Skip to content

Commit

Permalink
fix data race in ApplyCommit , cherry-pick 14709 (#14822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxinmeng1 committed Mar 7, 2024
1 parent 5d4ff58 commit f4b88a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/vm/engine/tae/catalog/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,11 @@ func (entry *TableEntry) ApplyCommit() (err error) {
if entry.isColumnChangedInSchema() {
entry.FreezeAppend()
}
entry.RLock()
schema := entry.GetLatestNodeLocked().BaseNode.Schema
entry.RUnlock()
// update the shortcut to the lastest schema
entry.TableNode.schema.Store(entry.GetLatestNodeLocked().BaseNode.Schema)
entry.TableNode.schema.Store(schema)
return
}

Expand Down

0 comments on commit f4b88a3

Please sign in to comment.