Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1b9050da66aba821fec18376bee30d17e91e7027^..421892a192b8f95ab96c5edb61d424f80a4221d0 #71

Merged
merged 17 commits into from
Dec 1, 2023

Conversation

Sairakan
Copy link

@Sairakan Sairakan commented Dec 1, 2023

17 commits, no merge conflicts.

Extension needed to be updated to match the change from 0f47457f1129fa21131465aba5663a14b2a09386 Remove our artificial PG_SOMAXCONN limit on listen queue length.

Extension PR for validation: amazon-aurora/babelfish_extensions#54

j-naylor and others added 17 commits December 1, 2023 19:13
Peter Smith

Discussion: https://www.postgresql.org/message-id/CAHut%2BPtRGVuj8Q_GpHHxZyk7fGwdYDG8_s4GSfKoc_4Yd9vR-w%40mail.gmail.com
(cherry picked from commit 1b9050da66aba821fec18376bee30d17e91e7027)
Using %u with uint16 causes warnings with -Wformat-signedness. There are many
other warnings, but for now change only these since c920fe4818 already changed
the message string for most of them.

Per report from Peter Eisentraut
Discussion: https://www.postgresql.org/message-id/31e63649-0355-7088-831e-b07d5f908a8c%40enterprisedb.com

(cherry picked from commit ba8321349bc02423aa4d49ebb5d579ec313cf930)
Somewhere during the development of the patch acquiring a lock during read
access to variable-numbered stats got lost. The missing lock acquisition won't
cause corruption, but can lead to reading torn values when accessing
stats. Add the missing lock acquisitions.

Reported-by: Greg Stark <[email protected]>
Reviewed-by: "Drouvot, Bertrand" <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Author: Kyotaro Horiguchi <[email protected]>
Discussion: https://postgr.es/m/CAM-w4HMYkM_DkYhWtUGV+qE_rrBxKOzOF0+5faozxO3vXrc9wA@mail.gmail.com
Backpatch: 15-
(cherry picked from commit cd063344fb801a90a40923a5b8aefe4eb8d80762)
All backends should have a BackendType to enable statistics reporting
per BackendType.

Add a new BackendType for standalone backends, B_STANDALONE_BACKEND (and
alphabetize the BackendTypes). Both the bootstrap backend and single
user mode backends will have BackendType B_STANDALONE_BACKEND.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://www.postgresql.org/message-id/CAAKRu_aaq33UnG4TXq3S-OSXGWj1QGf0sU%2BECH4tNwGFNERkZA%40mail.gmail.com
(cherry picked from commit 0c679464a837079acc75ff1d45eaa83f79e05690)
pgstat_report_stat() will be called before shutdown so an explicit call to
pgstat_report_wal() just before shutdown is redundant.

This likely was not redundant before 5891c7a, but now it clearly is.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://www.postgresql.org/message-id/CAAKRu_aaq33UnG4TXq3S-OSXGWj1QGf0sU%2BECH4tNwGFNERkZA%40mail.gmail.com
(cherry picked from commit 1bdd54e662d58ed49448255a004b668b56bae100)
No headers requiring FRONTED to be defined are included as of af1a949.

Since this is the last user of (contrib|frontend)_defines in Mkvcbuild.pm,
remove them.

Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit 06e3559bade1da89feb1a53d517c991fb4f15272)
Not needed anymore after 7143b3e.

Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit 9352d5cf128ad9888918bba00b87ba347438fd26)
Not needed anymore after 7143b3e.

Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit 1d77afefbd1dd13a0ebec9d6675dd305e86c0538)
While decoding changes in a loop, if we skip all the changes there is no
CFI making the loop uninterruptible.

Reported-by: Whale Song and Andrey Borodin
Bug: 17580
Author: Masahiko Sawada
Reviwed-by: Amit Kapila
Backpatch-through: 10
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit f972ec5c285c3bc50d81f8044e08cd636017ab68)
It's not necessary to fill in sun_len when calling bind() or connect(),
on all known systems that have it.

Discussion: https://postgr.es/m/2781112.1644819528%40sss.pgh.pa.us
(cherry picked from commit c9818798147a4eec00bba61a05fa9bc88398ec3b)
This was only needed to deal with some ancient and no longer supported
systems.

Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/9a5223a2-3e25-d4fb-f092-01ec17428584%40enterprisedb.com
(cherry picked from commit bd67b7e01031b688f2f19f657ece4aa2322dbcc8)
sysctl is more portable than Linux's /proc/sys file tree, and
often easier to use too.  That's why most of our docs refer to
sysctl when talking about how to adjust kernel parameters.
Bring the few stragglers into line.

Discussion: https://postgr.es/m/[email protected]
(cherry picked from commit 4ee6740167b6a311660a1e8752447a496dd0d235)
On fast machines, it's possible for applications such as pgbench
to issue connection requests so quickly that the postmaster's
listen queue overflows in the kernel, resulting in unexpected
failures (with not-very-helpful error messages).  Most modern OSes
allow the queue size to be increased, so document how to do that.

Per report from Kevin McKibbin.

Discussion: https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
(cherry picked from commit ba94dfd4c4f63cf8663f16e427bcc6fac35a4428)
I added this in commit 153f400, out of paranoia about kernels
possibly rejecting very large listen backlog requests.  However,
POSIX has said for decades that the kernel must silently reduce
any value it considers too large, and there's no evidence that
any current system doesn't obey that.  Let's just drop this limit
and save some complication.

While we're here, compute the request as twice MaxConnections not
twice MaxBackends; the latter no longer means what it did in 2001.

Per discussion of a report from Kevin McKibbin.

Discussion: https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
(cherry picked from commit 0f47457f1129fa21131465aba5663a14b2a09386)
Remove the contents of $Config{ldflags} from ExtUtils::Embed's ldopts,
like we already do with $Config{ccdlflags}.  Those flags are the
choices of those who built the Perl installation, which are not
necessarily appropriate for building PostgreSQL.  What we really want
from ldopts are the options identifying the location and name of the
libperl library, but unfortunately it doesn't appear possible to get
that separately from the other stuff.

The motivation for this was to strip -mmacosx-version-min options.  We
already did something similar for the -arch option.  Both of those are
now covered by this more general approach.

Reviewed-by: Tom Lane <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/8c4fcb72-2574-ff7c-4c25-1f032d4a2a57%40enterprisedb.com
(cherry picked from commit b4e936859dc441102eb0b6fb7a104f3948c90490)
(cherry picked from commit 869e56a39976a42a393adc2d69df3abce7eff18f)
In a similar effort to f01592f91, here we're targetting fixing the
warnings that -Wshadow=compatible-local produces that we can fix by moving
a variable to an inner scope to stop that variable from being shadowed by
another variable declared somewhere later in the function.

All of the warnings being fixed here are changing the scope of variables
which are being used as an iterator for a "for" loop.  In each instance,
the fix happens to be changing the for loop to use the C99 type
initialization.  Much of this code likely pre-dates our use of C99.

Reducing the scope of the outer scoped variable seems like the safest way
to fix these.  Renaming seems more likely to risk patches using the wrong
variable.  Reducing the scope is more likely to result in a compilation
failure after applying some future patch rather than introducing bugs with
it.

By my count, this takes the warning count from 129 down to 114.

Author: Justin Pryzby
Discussion: https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com
(cherry picked from commit 421892a192b8f95ab96c5edb61d424f80a4221d0)
Sairakan pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Dec 1, 2023
@2jungkook 2jungkook merged commit 2a7e202 into BABEL_main Dec 1, 2023
4 checks passed
@2jungkook 2jungkook deleted the pg16-cherry-pick-bff-1 branch December 1, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants