Skip to content

Commit

Permalink
[PG15] Initial merge with PG 15.2
Browse files Browse the repository at this point in the history
Historically, Yugabyte merged the following upstream PG commits

- YB 984667e:
  PG ab5e9caa4a3ec4765348a0482e88edcf3f6aab4a (tag: REL_10_4)
- YB cb4bd4c:
  PG 6cd404b344f7e27f4d64555bb133f18a758fe851 (tag: REL_11_2)

This commit is the start of the third merge:
PG 78ec02d612a9b69039ec2610740f738968fe144d (tag: REL_15_2).

The initial merge was a series of commits primarily authored by neil.
I, jason, squash those commits together into this one because his
individual commits were authored in a way that makes the history hard to
read.  I also use YugaBot as the official author/committer as that is
how it's historically done.  I leave the original commit messages below
as reference.

commit a6974e5
Author:     neil <[email protected]>
AuthorDate: Wed Oct 26 15:54:10 2022 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:22 2023 -0700

    Merge with some of Postgres 15

    Summary: Merge with PG13

    Test Plan:
    None

    Suppressed compiling Postgres's extension. Removed obsolete Postgres's types from docdb

commit f073ef1
Author:     Emily Na <[email protected]>
AuthorDate: Tue Jan 24 12:18:49 2023 -0500
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:22 2023 -0700

    [MERGE PG13][#14509]YSQL: Fix merge conflict occuring while checking the condition for creating a primary key index

    Summary:
    The attribute `yb_is_add_primary_key` was created as part of the `AlterTableCmd` struct to indicate this alter command is for adding primary key.
    In the past, there were 2 subcommands involved when creating a primary key: 1) `AddIndex` 2) `SetNotNull` (only if any one of the primary key attributes are not set as NOT NULL).
    In PG13, setting the primary key columns to NOT NULL is triggered in a separate API called `transformIndexConstraint`.
    The boolean flag has been set in the corresponding section where `AlterTableCmd` is prepared to alter the primary key column to be not null.

    Here is the excerpt from the PG13 comment mentioning the need to satisfy NOT NULL requirement prior to creating primary key index:
    ```Now we expect that the parser inserted any required ALTER TABLE SET NOT NULL operations before trying to create a primary-key index.```

    Test Plan: Jenkins

    Reviewers: neil, myang

    Reviewed By: myang

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D21331

commit 85d6668
Author:     Jason Kim <[email protected]>
AuthorDate: Fri Jan 27 12:11:07 2023 -0800
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:22 2023 -0700

    [MERGE PG13] ysql: fix some compilation errors

    Summary:
    Fix two compilation errors:

    - release build got -Wsometimes-uninitialized compilation error because of
      Assert(false) that is treated differently in release/debug builds
    - gcc build got -Werror=comment because of bad comment

    Test Plan:
    Jenkins: compile only, rebase: pg13

        ./yb_build.sh fastdebug --gcc11 --no-initdb
        ./yb_build.sh release --clang15 --no-initdb

    Reviewers: smishra, neil

    Reviewed By: neil

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D22577

commit b15ae1e
Author:     Fizaa Luthra <[email protected]>
AuthorDate: Thu Feb 2 11:58:29 2023 -0500
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:23 2023 -0700

    [MERGE PG13][#14506] Fix YbClearCurrentTransactionId()

    Summary:
    YbClearCurrentTransactionId() was introduced to handle temp tables created during concurrent
    materialized view refreshes correctly.
    PG13 no longer uses `CurrentTransactionState->transactionId` and `MyPgXact`. This diff changes the
    code to use the PG13 equivalent of these fields/structures -
    `CurrentTransactionState->fullTransactionId` and `MyProc->xid`.

    Test Plan: Jenkins: skip

    Reviewers: neil, smishra

    Reviewed By: neil, smishra

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D21721

commit f675a5f
Author:     Jason Kim <[email protected]>
AuthorDate: Wed Feb 22 18:23:38 2023 -0800
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:23 2023 -0700

    [MERGE PG15] ysql: add yb_make_greater_string

    Summary:
    When migrating from PG 11.2 to PG 15, we come across commit
    49fa99e54ec0ded180b52a4a14e543702d53e8c9 that makes make_greater_string
    private:

        Move pattern selectivity code from selfuncs.c to like_support.c.
        ...
        This change localizes the use of pattern_fixed_prefix() and
        make_greater_string() so that they no longer need be exported.
        (We might get pushback from extensions about that, perhaps,
        in which case I'd be inclined to re-export them in a new header
        file like_support.h.)
        ...

    ybgin uses make_greater_string for tsvector prefix logic.  Since it is
    not trivial to indirectly get the benefit of make_greater_string through
    the publicly exposed support functions (they take complex Node
    argument), lean towards re-exposing the function through new header
    yb_like_support.h and new function yb_make_greater_string.  If, in the
    future, upstream postgres decides to expose make_greater_string, these
    changes can be scrapped in favor of using make_greater_string again.

    Test Plan: Jenkins: compile only, rebase: pg15

    Reviewers: neil, amartsinchyk

    Reviewed By: amartsinchyk

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D23110

commit 68f9934
Author:     Jason Kim <[email protected]>
AuthorDate: Wed Mar 1 18:34:27 2023 -0800
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:23 2023 -0700

    [MERGE PG15] test: fix python doctest failure

    Summary:
    build-support/jenkins/build-and-test.sh involves running doctest on
    select python files.  This is what jenkins runs, whereas developers
    typically run ./yb_build.sh.

    doctest appears to have a strange bug where it does not like it when
    sys.stdout is set to something else by the time of the end of file.
    This doesn't seem to matter when executing the python script itself: it
    only matters for doctest.  PG 15 merge involves updating
    generate_unaccent_rules.py, and this update hits the above bug.  Appease
    doctest by restoring sys.stdout to the original object at the end of the
    file.

    It seems wasteful to run doctest on files that don't have docstrings,
    but that can be fixed in the future.

    Test Plan: jenkins: compile only, rebase: pg15

    Reviewers: mbautin, neil, steve.varnau

    Reviewed By: steve.varnau

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D23266

commit 56401ef
Author:     Steve Song <[email protected]>
AuthorDate: Wed Nov 16 09:39:49 2022 +0000
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:23 2023 -0700

    [MERGE 15] YSQL: Fix name conflict in aset realloc

    Summary:
        In the master branch, for memory tracking, we added `oldsize` for the block.
        It overwrites the variable with the same name in the outer scope, defined for the chunk.
        However, in PG upstream, the `oldsize` in the outer scope is referenced in the inner scope.
        Because of the naming overwritting, after merging, the reference used becomes incorrect.

        **Solution**
        I basically "backport" how the upstream creates the variable for "block old size" and use
        it is for YB memory tracking.

        Along with this, it also fixes two potential overflow issues in the existing code.
        The fixes are needed in the master as well. So a backport to the PG13 branch will be committed later
        in a separate diff.

    Original commit: 83c6b6a/D21128

    Test Plan: Jenkins: rebase: pg15

    Reviewers: neil, mbautin, telgersma

    Reviewed By: telgersma

    Subscribers: smishra, yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D24000

commit 7e541a1
Author:     neil <[email protected]>
AuthorDate: Mon Apr 10 09:31:46 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:26 2023 -0700

    Complete merging with Postgres 15.2

    Fixed compilation errors in /access, /bootstrap, /catalog, and /commands

    Fixed compilation errors in /parser

    Fixed compilation errors in /commands

    Fixed compilation errors in /executor

    Fixed compilation errors in /libpq

    Fixed compilation errors in /optimizer

    Fixed compilation errors in /utils

    Completed fixing errors for directories in /backend/*

    Commented out Yugabyte's code for tools in src/bin - Revisit later

    Add missing files in contrib

    Add missing files in postgres/doc

commit 06d9200
Author:     neil <[email protected]>
AuthorDate: Wed May 3 21:38:01 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:28 2023 -0700

    Rebase with yb::master up to commit 61302b0

    Fixed compilation errors in src/backend

    Fixed compilation errors in pg_dump

    Used Pg15 structure for FunctionCallInfo

    Remove Yugabyte version of pull_varattnos_walker() to avoid duplicating code with Pg15.

    Activate Yugabyte cluster-connecting code in InitPostgres

commit 065c1a2
Author:     Arpan Agrawal <[email protected]>
AuthorDate: Mon May 1 23:59:08 2023 +0530
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:28 2023 -0700

    [MERGE PG15] Adds missing oid columns and indexes to YB system tables

    Summary: Adds missing oid columns and indexes to YB system tables

    Test Plan: N/A

    Reviewers: mihnea, neil

    Reviewed By: neil

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D24959

commit 69fa310
Author:     neil <[email protected]>
AuthorDate: Sun May 7 12:37:33 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:28 2023 -0700

    Rebase with yb::master up to commit 3d3480b

commit 1cc244c
Author:     Arpan Agrawal <[email protected]>
AuthorDate: Fri May 5 16:26:21 2023 +0530
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:28 2023 -0700

    [MERGE PG15] Initdb: Bootstrap step working

    Summary: Initdb bootstrap step working

    Test Plan: Jenkins: skip

    Reviewers: mihnea, neil

    Reviewed By: neil

    Subscribers: yql

    Differential Revision: https://phabricator.dev.yugabyte.com/D25090

commit 57688f4
Author:     neil <[email protected]>
AuthorDate: Sat May 13 15:27:45 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:29 2023 -0700

    Rebase with yb::master up to commit 9662afb

commit 963f869
Author:     neil <[email protected]>
AuthorDate: Sat May 20 15:58:54 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:29 2023 -0700

    Rebase with yb::master up to commit d5d857e

commit b2ca34c
Author:     Arpan Agrawal <[email protected]>
AuthorDate: Mon May 15 13:46:56 2023 +0530
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:29 2023 -0700

    [MERGE PG15] Initdb fixes till setup_collation()

    Summary: Initdb fixes till setup_collation()

    Test Plan: Jenkins: skip

    Reviewers: neil, mihnea

    Reviewed By: neil

    Subscribers: yql

    Differential Revision: https://phorge.dev.yugabyte.com/D25341

commit fb32975
Author:     Arpan Agrawal <[email protected]>
AuthorDate: Thu Jun 1 22:08:41 2023 +0530
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:29 2023 -0700

    [MERGE PG15] Initdb working end to end

    Summary: With this diff, initdb is working end to end except for pg_stat_statements.

    Test Plan: Jenkins: rebase: no

    Reviewers: neil, mihnea

    Reviewed By: neil

    Subscribers: yql

    Differential Revision: https://phorge.dev.yugabyte.com/D25787

commit eae7ba6
Author:     neil <[email protected]>
AuthorDate: Sun Jun 4 11:53:12 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:29 2023 -0700

    Merge with yb::master up to commit 6d92aa6

commit 59f8df7
Author:     neil <[email protected]>
AuthorDate: Mon Jun 19 15:04:10 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 02:08:30 2023 -0700

    Rebase with master upto commit dc4781a

commit 50a962e
Author:     neil <[email protected]>
AuthorDate: Thu Jul 20 10:24:57 2023 -0700
Commit:     neil <[email protected]>
CommitDate: Thu Jul 20 10:24:57 2023 -0700

    Rebase with master upto commit 1c781b7
  • Loading branch information
yugabot committed Oct 27, 2023
1 parent 1c781b7 commit 55782d5
Show file tree
Hide file tree
Showing 5,330 changed files with 1,159,330 additions and 677,480 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 4 additions & 3 deletions python/yugabyte/build_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,10 @@ def make_postgres(self) -> None:

third_party_extensions_dir = os.path.join(self.pg_build_root, 'third-party-extensions')
work_dirs = [
self.pg_build_root,
os.path.join(self.pg_build_root, 'contrib'),
third_party_extensions_dir
self.pg_build_root
# self.pg_build_root,
# os.path.join(self.pg_build_root, 'contrib'),
# third_party_extensions_dir
]

for work_dir in work_dirs:
Expand Down
Loading

0 comments on commit 55782d5

Please sign in to comment.