Commit 913fee4
authored
core/rawdb: skip setting flushOffset in read-only mode (#31173)
This PR addresses a flaw in the freezer table upgrade path.
In v1.15.0, freezer table v2 was introduced, including an additional
field (`flushOffset`) maintained in the metadata file. To ensure
backward compatibility, an upgrade path was implemented for legacy
freezer tables by setting `flushOffset` to the size of the index file.
However, if the freezer table is opened in read-only mode, this file
write operation is rejected, causing Geth to shut down entirely.
Given that invalid items in the freezer index file can be detected and
truncated, all items in freezer v0 index files are guaranteed to be
complete. Therefore, when operating in read-only mode, it is safe to
use the freezer data without performing an upgrade.1 parent 8ec4a06 commit 913fee4
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
| |||
0 commit comments