add _fsm _vm dump - #43
Conversation
|
Hmm. Does this add anything over the in-core pg_freespacemap and pg_visibility modules? pg_filedump is mostly meant to be used in situations where the server doesn't even start, and the fsm/vm forks should be entirely optional. |
|
Hello! On top of pg_freespacemap / pg_visibility:
Moreover:
Example of where this would help - a recent pgsql-hackers thread [1] describes FSM data on a standby silently diverging from the primary during recovery, causing slow inserts after failover. An offline dump/diff tool like this would make such discrepancies easy to catch and reproduce. |
|
@df7cb, may be you have suggestions for code improvements? or other wishes regarding this pull request? |
|
Hi, sorry for not replying last week. I'm currently on vacation and need to have a deeper look at it when I return. |
Add support for parsing
_fsmand_vmfilesMotivation
pg_filedumpcurrently only supports parsing the main fork of heap/index files — there's no human-readable dump support for _vm (visibility map) and _fsm (free space map) files, so diagnosing them requires reading raw bytes by hand.This also helps with debugging in general:
What's added
New parsing modes for
_fsmand_vm, plus adiffmode to compare two dumps of the same fork.Flags
pg_fsm-Hfp_next_slot-i-s-a-q--range A-B/--page N--extra--heap-page N--min N/--max Navail_bytes(dump-sonly)--only-changedpg_vm-H-q--heap-range A-B--heap-page N--expand--only-not-visible/--only-not-frozen / --notF / --notV--only-changedExample usage
pg_fsm-H— page headers-i— internal tree nodes-s— leaf slots-a— combined flags -His-q— summary--range A-B/--page N- page in range--extra--heap-page N- jnly one heap page--min N/--max Ndiff mode
--only-changed(diff mode)pg_vm-H— page header dump-q— summary--heap-range A-B--heap-page N--expand--only-not-visible/ (--only-not-frozen)(diff mode)
--only-changed(diff mode)