Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffb0603

Browse files
committed
Improve comments in slru.{c,h} about segment name format
slru.h described incorrectly how SLRU segment names are formatteddepending on the segment number and if long or short segment names areused. This commit closes the gap with a better description, fittingwith the reality.Reported-by: Noah MischAuthor: Aleksander AlekseevDiscussion:https://postgr.es/m/20240626002747.dc.nmisch@google.comBackpatch-through: 17
1 parent65504b7 commitffb0603

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

‎src/backend/access/transam/slru.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,21 @@
7272
#include"storage/shmem.h"
7373
#include"utils/guc_hooks.h"
7474

75+
/*
76+
* Converts segment number to the filename of the segment.
77+
*
78+
* "path" should point to a buffer at least MAXPGPATH characters long.
79+
*
80+
* If ctl->long_segment_names is true, segno can be in the range [0, 2^60-1].
81+
* The resulting file name is made of 15 characters, e.g. dir/123456789ABCDEF.
82+
*
83+
* If ctl->long_segment_names is false, segno can be in the range [0, 2^24-1].
84+
* The resulting file name is made of 4 to 6 characters, as of:
85+
*
86+
* dir/1234 for [0, 2^16-1]
87+
* dir/12345 for [2^16, 2^20-1]
88+
* dir/123456 for [2^20, 2^24-1]
89+
*/
7590
staticinlineint
7691
SlruFileName(SlruCtlctl,char*path,int64segno)
7792
{

‎src/include/access/slru.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ typedef struct SlruCtlData
134134
bits16bank_mask;
135135

136136
/*
137-
* If true, use long segment filenames formed from lower 48 bits of the
138-
* segment number, e.g. pg_xact/000000001234. Otherwise, use short
139-
* filenames formed from lower 16 bits of the segment number e.g.
140-
* pg_xact/1234.
137+
* If true, use long segment file names. Otherwise, use short file names.
138+
*
139+
* For details about the file name format, see SlruFileName().
141140
*/
142141
boollong_segment_names;
143142

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp