Commit 87ea5b8
authored
add disable prealloc (#23209)
### **User description**
## What type of PR is this?
- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring
## Which issue(s) this PR fixes:
issue #
## What this PR does / why we need it:
___
### **PR Type**
Enhancement, Bug fix
___
### **Description**
- Add `LogDBDisablePrealloc` configuration option to disable file
preallocation
- Propagate the setting to the underlying dragonboat LogDB configuration
- Update dragonboat dependency to version with prealloc support
- Support filesystems like NFS that don't support fallocate system call
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Config struct"] -- "LogDBDisablePrealloc field" --> B["getNodeHostConfig"]
B -- "assigns to logdb.DisablePrealloc" --> C["dragonboat LogDB"]
D["go.mod dependency"] -- "updated to v4.0.0-20251203123148" --> C
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>config.go</strong><dd><code>Add LogDBDisablePrealloc
configuration field</code>
</dd></summary>
<hr>
pkg/logservice/config.go
<ul><li>Added <code>LogDBDisablePrealloc</code> boolean field to Config
struct<br> <li> Field is mapped to TOML configuration key
<code>logdb-disable-prealloc</code><br> <li> Includes documentation
explaining the purpose for NFS and similar <br>filesystems</ul>
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/23209/files#diff-840aed48ffce69ec32afc8354a2223c3029b0dd64f3eef440283608154470c1b">+3/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>store.go</strong><dd><code>Propagate prealloc disable
setting to LogDB</code>
</dd></summary>
<hr>
pkg/logservice/store.go
<ul><li>Propagates <code>LogDBDisablePrealloc</code> config value to
dragonboat's logdb <br>configuration<br> <li> Assigns
<code>cfg.LogDBDisablePrealloc</code> to
<code>logdb.DisablePrealloc</code> in <br>getNodeHostConfig
function</ul>
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/23209/files#diff-c0fcef3144fd52dba31ca97e6755c28d2bba11b6837fa1585fb17199b7a12e72">+1/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>go.mod</strong><dd><code>Update dragonboat dependency
version</code>
</dd></summary>
<hr>
go.mod
<ul><li>Updated dragonboat/v4 dependency from
<br>v4.0.0-20241019050137-1c6138e9cf8b to
<br>v4.0.0-20251203123148-9dcde946363f<br> <li> New version includes
support for DisablePrealloc configuration option</ul>
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/23209/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>go.sum</strong><dd><code>Update dragonboat dependency
checksums</code>
</dd></summary>
<hr>
go.sum
<ul><li>Updated hash entries for dragonboat/v4 dependency to match new
version<br> <li> Reflects the updated dependency version in go.sum
checksums</ul>
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/23209/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+2/-2</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___1 parent 8d3e34b commit 87ea5b8
4 files changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
| 536 | + | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
0 commit comments