Skip to content

Commit 0c8f3ac

Browse files
committed
sql: disable buffered writes on the txn when it's used by IE
This commit is a follow-up to 07d8902 where we disabled the session variable that controls whether buffered writes are enabled when the variable is consulted by the internal executor. That change had an oversight - that if the IE is using already created txn, the session variable has no influence, so this commit explicitly disables buffered writes on the txn whenever it's used by the IE for the first time. Release note: None
1 parent 23b761e commit 0c8f3ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/sql/internal.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,12 @@ func (ie *InternalExecutor) execInternal(
11851185

11861186
applyInternalExecutorSessionExceptions(sd)
11871187
applyOverrides(sessionDataOverride, sd)
1188+
if txn != nil && txn.Type() == kv.RootTxn {
1189+
// For 25.2, we're being conservative and explicitly disabling buffered
1190+
// writes for the internal executor.
1191+
// TODO(yuzefovich): remove this for 25.3.
1192+
txn.SetBufferedWritesEnabled(false)
1193+
}
11881194
attributeToUser := sessionDataOverride.AttributeToUser && attributeToUserEnabled.Get(&ie.s.cfg.Settings.SV)
11891195
growStackSize := sessionDataOverride.GrowStackSize
11901196
if !rw.async() && (txn != nil && txn.Type() == kv.RootTxn) {

0 commit comments

Comments
 (0)