You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kvclient: flush the write buffer if it gets too large
This patch introduces a new cluster setting,
kv.transaction.write_buffering.max_buffer_size, which dictates how
large a transaction's write buffer can get before we decide to flush
all buffered writes to KV. It defaults to 4MB, for now.
Once a transaction's buffer is flushed, subsequent writes will no longer
be buffered on the client. Instead, the transaction will write intents,
as it would have in a pre-buffered writes world.
I briefly considered other schemes where we didn't disable buffered
writes completely once a transaction goes over budget -- either by
only flushing the buffer partly or flushing the buffer in its entirety
but allowing subsequent writes to be buffered as long as the transaction
has budget. However, I decided against either of these, as many of the
benefits of having buffered writes (e.g. 1PC) are no longer possible
after the first flush. Moreover, other benefits (e.g. batching, cheaper
read-your-own-writes) don't generalize either. For now, we do the simple
thing.
Resolves#139056
Release note: None
Copy file name to clipboardExpand all lines: docs/generated/settings/settings-for-tenants.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,7 @@ kv.transaction.max_refresh_spans_bytes integer 4194304 maximum number of bytes u
98
98
kv.transaction.randomized_anchor_key.enabled boolean false dictates whether a transactions anchor key is randomized or not application
99
99
kv.transaction.reject_over_max_intents_budget.enabled boolean false if set, transactions that exceed their lock tracking budget (kv.transaction.max_intents_bytes) are rejected instead of having their lock spans imprecisely compressed application
100
100
kv.transaction.write_buffering.enabled boolean false if enabled, transactional writes are buffered on the client application
101
+
kv.transaction.write_buffering.max_buffer_size integer 4194304 if non-zero, defines that maximum size of the buffer that will be used to buffer transactional writes per-transaction application
101
102
kv.transaction.write_pipelining.locking_reads.enabled boolean true if enabled, transactional locking reads are pipelined through Raft consensus application
102
103
kv.transaction.write_pipelining.ranged_writes.enabled boolean true if enabled, transactional ranged writes are pipelined through Raft consensus application
103
104
kv.transaction.write_pipelining.enabled (alias: kv.transaction.write_pipelining_enabled) boolean true if enabled, transactional writes are pipelined through Raft consensus application
Copy file name to clipboardExpand all lines: docs/generated/settings/settings.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,7 @@
127
127
<tr><td><divid="setting-kv-transaction-randomized-anchor-key-enabled" class="anchored"><code>kv.transaction.randomized_anchor_key.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>dictates whether a transactions anchor key is randomized or not</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
128
128
<tr><td><divid="setting-kv-transaction-reject-over-max-intents-budget-enabled" class="anchored"><code>kv.transaction.reject_over_max_intents_budget.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>if set, transactions that exceed their lock tracking budget (kv.transaction.max_intents_bytes) are rejected instead of having their lock spans imprecisely compressed</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
129
129
<tr><td><divid="setting-kv-transaction-write-buffering-enabled" class="anchored"><code>kv.transaction.write_buffering.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>if enabled, transactional writes are buffered on the client</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
130
+
<tr><td><divid="setting-kv-transaction-write-buffering-max-buffer-size" class="anchored"><code>kv.transaction.write_buffering.max_buffer_size</code></div></td><td>integer</td><td><code>4194304</code></td><td>if non-zero, defines that maximum size of the buffer that will be used to buffer transactional writes per-transaction</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
130
131
<tr><td><divid="setting-kv-transaction-write-pipelining-locking-reads-enabled" class="anchored"><code>kv.transaction.write_pipelining.locking_reads.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled, transactional locking reads are pipelined through Raft consensus</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
131
132
<tr><td><divid="setting-kv-transaction-write-pipelining-ranged-writes-enabled" class="anchored"><code>kv.transaction.write_pipelining.ranged_writes.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled, transactional ranged writes are pipelined through Raft consensus</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
132
133
<tr><td><divid="setting-kv-transaction-write-pipelining-enabled" class="anchored"><code>kv.transaction.write_pipelining.enabled<br/>(alias: kv.transaction.write_pipelining_enabled)</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled, transactional writes are pipelined through Raft consensus</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
0 commit comments