Re: Is this a problem in GenericXLogFinish()?
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
'Amit Kapila' <amit.kapila16@gmail.com>
Cc: 'Michael Paquier' <michael@paquier.xyz>,
'Robert Haas' <robertmhaas@gmail.com>, 'Jeff Davis' <pgsql@j-davis.com>,
'Heikki Linnakangas' <hlinnaka@iki.fi>,
"'pgsql-hackers@postgresql.org'" <pgsql-hackers@postgresql.org>
Date: 2023-11-30T11:00:01Z
Lists: pgsql-hackers
Hello Kuroda-san, 30.11.2023 10:28, Hayato Kuroda (Fujitsu) wrote: > Again, good catch. Here is my analysis and fix patch. > I think it is sufficient to add an initialization for writebuf. I agree with the change. It aligns hash_xlog_squeeze_page() with hash_xlog_move_page_contents() in regard to initialization of writebuf. Interestingly enough, the discrepancy exists since these functions appeared with c11453ce0, and I can't see what justified adding the initialization inside hash_xlog_move_page_contents() only. So I think that if this doesn't affect performance, having aligned coding (writebuf initialized in both functions) is better. > I want to add a test case for it as well. I've tested on my env and found that proposed > tuples seems sufficient. > (We must fill the primary bucket, so initial 500 is needed. Also, we must add > many dead pages to lead squeeze operation. Final page seems OK to smaller value.) > > I compared the execution time before/after patching, and they are not so different > (1077 ms -> 1125 ms). > > How do you think? I can confirm that the test case proposed demonstrates what is expected and the duration increase is tolerable, as to me. Best regards, Alexander
Commits
-
Fix inconsistency with replay of hash squeeze record for clean buffers
- f56a9def71bb 17.0 landed
-
Set LSN for wbuf in _hash_freeovflpage() iff wbuf is modified.
- aa5edbe379d6 17.0 landed
-
Fix an uninitialized access in hash_xlog_squeeze_page().
- f66fcc5cd616 17.0 landed
-
Use REGBUF_NO_CHANGE at one more place in the hash index.
- 861f86beea1c 17.0 landed
-
Assert that buffers are marked dirty before XLogRegisterBuffer().
- 00d7fb5e2e39 17.0 landed
-
Fix bug in GenericXLogFinish().
- 04f0baa85865 11.22 landed
- 6dbd01b9fdad 12.17 landed
- 469d367bee2f 13.13 landed
- 6615bb95af2d 14.10 landed
- b9bb02620d4b 15.5 landed
- b8963e8a2854 16.1 landed
- ef74c7197c04 17.0 landed
-
Improve hash index bucket split behavior.
- 6d46f4783efe 10.0 cited