static global variable openLogOff in xlog.c seems no longer used

Started by Takashi Menjoover 7 years ago3 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t40042
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 04:43 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t40042_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t40042_1 && git checkout t40042_1

Patchset v1 (message #1) is on t40042_1

Jump to latest
#1Takashi Menjo
menjo.takashi@lab.ntt.co.jp

Hi,

Because of pg_pwrite()[1]See commit c24dcd0cfd949bdf245814c4c2b3df828ee7db36., openLogOff, a static global variable in xlog.c,
seems taken over by a local variable startoffset and no longer used now.

I write the attached patch that removes openLogOff. Both "make check" and
"make installcheck" passed, and just after that, "pg_ctl -m immediate stop"
then "pg_ctl start" looked OK.

Regards,
Takashi

[1]: See commit c24dcd0cfd949bdf245814c4c2b3df828ee7db36.

--
Takashi Menjo - NTT Software Innovation Center
<menjo.takashi@lab.ntt.co.jp>

Attachments:

t40042_1
Remove-openLogOff.patchapplication/octet-stream; name=Remove-openLogOff.patchDownload+1-7
#2Michael Paquier
michael@paquier.xyz
In reply to: Takashi Menjo (#1)
Re: static global variable openLogOff in xlog.c seems no longer used

On Tue, Jan 29, 2019 at 11:49:37AM +0900, Takashi Menjo wrote:

Because of pg_pwrite()[1], openLogOff, a static global variable in xlog.c,
seems taken over by a local variable startoffset and no longer used
now.

It seems to me that keeping openLogOff is still useful to get a report
about the full chunk area being written if the data gets written in
multiple chunks and fails afterwards. Your patch would modify the
report so as only the area with the partial write is reported. For
debugging, having a static reference is also useful in my opinion.
--
Michael

#3Takashi Menjo
menjo.takashi@lab.ntt.co.jp
In reply to: Michael Paquier (#2)
RE: static global variable openLogOff in xlog.c seems no longer used

Michael Paquier wrote:

It seems to me that keeping openLogOff is still useful to get a report
about the full chunk area being written if the data gets written in
multiple chunks and fails afterwards. Your patch would modify the
report so as only the area with the partial write is reported. For
debugging, having a static reference is also useful in my opinion.

I agree with you on both error reporting and debugging. Now that you
mention it, I find that my patch modifies ereport...

When I wrote a patchset to xlog.c (in another email thread), I thought that
this can be fixed. But now I understand it is not a simple thing. Thank
you.

Regards,
Takashi

--
Takashi Menjo - NTT Software Innovation Center
<menjo.takashi@lab.ntt.co.jp>