Skip to content

Commit

Permalink
[pg15] merge: master commit 'd4103e809e0662c5cd4a51f9dfafb44ce210d38c…
Browse files Browse the repository at this point in the history
…' into pg15

Summary:
Merge YB master commit d4103e8 titled

    [#23513]  YSQL: Fix broken org.yb.pgsql.TestYsqlMetrics#testExplainMaxMemory unit test

and committed 2024-09-18T13:24:18+03:00 into YB pg15.

YB pg15 initial merge refers to
55782d5.

- yb_lsm.c:
  - ybcinbuildCallback: adjacent conflict between YB pg15
    b263910 changing ybcinbuildCallback
    signature and YB master f0a5db7
    adding new function doAssignForIdxUpdate.
- tablecmds.c:
  - declarations:
    - ATExecAddIndexConstraint: YB master
      2ac2e98 adds a new parameter
      yb_wqueue to this function that upstream PG
      8255c7a5eeba8f1a38b7a431c04909bde4f5e67d changes the indentation
      for.  Trivial merge.
    - ATPrepSetTableSpace: YB master
      06baaf0 introduces a new
      parameter to this function that upstream PG changes indentation
      for.  Trivial merge.
  - ATRewriteTable: after YB master
    24a5af0, ALTER TABLE VALIDATE
    CONSTRAINT is supported.  Upstream PG commit
    f1fcf2d3b2e00b3d7ad3e0d2b1d26b77f5a48413 delays constraint
    validation for ALTER TABLE VALIDATE CONSTRAINT to phase 3 of alter
    table.  So it shares the code paths for constraint validation with a
    regular ADD CONSTRAINT operation.  YB has added logic to
    ATExecDropConstraint in case of constraint failure.  This is only
    intended for ADD CONSTRAINT, but now that code paths are shared,
    this also affects VALIDATE CONSTRAINT incorrectly.  The original
    logic also could use !YbDdlRollbackEnabled to avoid
    ATExecDropConstraint in case DDL atomicity is enabled.  This is
    orthogonal to the issue, but it at least helps get the tests to pass
    for now since DDL atomicity is enabled by default.  Do that
    improvement here, and add a todo to fix the condition properly.
- execIndexing.c:
  - includes: YB master f0a5db7
    includes catalog/pg_am_d.h.  YB pg15 initial merge touches the same
    area.
  - YbExecDoInsertIndexTuple: (see ExecInsertIndexTuples)
  - ExecInsertIndexTuples:
    - for loop variable declarations: YB master
      f0a5db7 moves three variable
      declarations into new YbExecDoInsertIndexTuple and moves skip
      index logic into new YbExecUpdateIndexTuples.  Upstream PG
      9dc718bdf2b1a574481a45624d42b674332e2903 adds indexUnchanged
      variable declaration among the three variable declarations.  Move
      that to the new location as well.
    - for loop after check for partial index: YB master
      f0a5db7 moves code into new
      YbExecDoInsertIndexTuple.  YB pg15 initial merge and
      b263910 modify this moved code
      (add indexUnchanged computation and modify two satisfiesConstraint
      assignments).  Apply the modifications to the new location.  (This
      also involves forwarding local variable "update" and "tupleid" as
      opposed to "tuple".  And also copying local variables
      "heapRelation" and "isYBRelation".)
  - YbExecDoDeleteIndexTuple: (see ExecDeleteIndexTuples)
  - ExecDeleteIndexTuples: YB master
    f0a5db7 moves code into new
    YbExecDoDeleteIndexTuple.  YB pg15 initial merge touches this code
    (renaming index_delete to yb_index_delete).  Apply the modification
    to the new location.  (This also involves copying local variable
    "heapRelation".)
  - YbExecUpdateIndexTuples:
    YB master f0a5db7 adds this
    function:
    - signature:
      - Upstream PG 1375422c7826a2bf387be29895e961614f69de4b changes
        ResultRelInfo to be passed around directly rather than deriving
        it from EState.  Add it as a parameter and remove the invalid
        code trying to derive it from estate.
      - Change "tuple" to "tupleid" similar to YbExecDoInsertIndexTuple.
    - MakeSingleTupleTableSlot: upstream PG adds additional param to
      this function.  Pass &TTSOpsHeapTuple.
    - ybamcanupdatetupleinplace: upstream PG
      346ed70b0ad7efc574711a97812692dab4542712 renames rd_amroutine to
      rd_indam.  Change it for this new usage as well.
    - YbExecDoInsertIndexTuple: (see YbExecUpdateIndexTuples signature)
- nodeModifyTable.c:
  - ExecUpdate: YB master f0a5db7
    replaces ExecDeleteIndexTuplesOptimized +
    ExecInsertIndexTuplesOptimized with YbExecUpdateIndexTuples and
    passes yb_cols_marked_for_update to that call.  YB
    pg15 initial merge moves this code to ExecUpdateEpilogue (also note
    the functions were renamed to not have "Optimized"), and YB pg15
    6d46032 moves the
    yb_cols_marked_for_update code into YBExecUpdateAct.  To resolve
    this, there are two main things:
    - Replace the delete + insert with update in the new location
      ExecUpdateEpilogue.
    - Pass around variables across the functions that need it,
      particularly yb_cols_marked_for_update but also yb_is_pk_updated.
      This also involves changing the lifetime of the variables.
  - YBExecUpdateAct: (see ExecUpdate)
  - ExecUpdateEpilogue:
    - signature: (see ExecUpdate)
    - YbExecUpdateIndexTuples: YB master
      f0a5db7 adds this function call.
      Adapt to signature changes mentioned above and change planSlot to
      context->planSlot and estate to context->estate.
  - ExecMergeMatched: this function is introduced by upstream PG and
    calls ExecUpdateEpilogue.  The signature of ExecUpdateEpilogue is
    changed by YB master f0a5db7.
    Populate the new parameters with default/fake values and add a todo
    because MERGE is not supported yet.
- nodeYbSeqscan.c:
  - YbSeqNext: YB master 7f59bd8
    touches code where YB pg15 71dc8d0
    changes scandesc->ybscan to ybScan.  Trivial merge.
- costsize.c:
  - yb_get_bitmap_index_quals: YB master
    a913524 makes changes that are not
    relevant to pg15.  Discard the master changes.
- gram.y:
  - "ALTER TABLE <name> SET TABLESPACE <tablespacename>": adjacent
    conflict between YB master 06baaf0
    adding n->yb_cascade = false and upstream PG
    30ed71e423ee63b263730b86326da2a629a29f84 changing style of adjacent
    line.
- guc.c:
  - yb_plpgsql_disable_prefetch_in_for_query: adjacent lines conflict
    between YB pg15 91a265a touching
    GUC yb_plpgsql_disable_prefetch_in_for_query (QUERY_TUNING to
    QUERY_TUNING_METHOD) and YB master
    063dbe5 adding GUC
    yb_make_next_ddl_statement_nonincrementing above that.
- amapi.h:
  - struct IndexAmRoutine: adjacent lines conflict between YB master
    f0a5db7 adding
    ybamcanupdatetupleinplace and upstream PG
    4d8a8d0c738410ec02aab46b1ebe1835365ad384 adding
    amusemaintenanceworkmem and amparallelvacuumoptions in the same
    location.
- genam.h:
  - yb_index_update: adjacent lines conflict between YB master
    f0a5db7 adding this function and YB
    pg15 initial merge renaming index_delete to yb_index_delete.
- executor.h:
  - YbExecUpdateIndexTuples: adjacent lines conflict between YB master
    f0a5db7 adding this function and
    various YB pg15 commits touching surrounding code, the most relevant
    being YB pg15 initial merge moving ExecDeleteIndexTuples declaration
    lower.  Position the new YbExecUpdateIndexTuples below that.
    Furthermore, update the signature according as mentioned above in
    execIndexing.c.
- ybcModifyTable.h:
  - YBCExecuteUpdateIndex: YB master
    f0a5db7 adds this function where YB
    pg15 473ebf8 incorrectly removes a
    line, causing merge conflict.  Bring back the line.
- relcache.h:
  - CheckUpdateExprOrPred: YB master
    f0a5db7 adds this function below
    CheckIndexForUpdate.  YB pg15 moves CheckIndexForUpdate lower, and
    upstream PG e7eea52b2d61917fbbdac7f3f895e4ef636e935b adds new
    function RelationGetIdentityKeyBitmap in the original area.  Add
    this function to the new location.  (Note both Check* functions are
    YB functions despite not having YB prefix.)
- yb_pg_foreign_data.out:
  - "ALTER TABLE fd_pt1 VALIDATE CONSTRAINT fd_pt1chk3": YB master
    24a5af0 no longer expects this
    command to fail.  YB pg15 1b1b3a0
    makes minor changes in this area.  Take master's version.  This
    involves removing YB comment saying the output differs with upstream
    since it no longer differs.
  - a little below that: YB master
    24a5af0 updates output for queries
    that are deleted by YB pg15 1b1b3a0
    because WITH OIDS is no longer supported.  Drop the master changes.
- yb_pg_index_including.out:
  - "CREATE TABLE tbl_include_box": both YB master
    2ac2e98 and YB pg15
    9690419 uncomment some tests.
    These tests were ported, modified to change the box column to int,
    and commented out.  Likely what happened is that, at the time,
    include index using box column was not supported.  YB pg15's
    uncommenting reverts this back to using the box column, so it is
    superior.  Take YB pg15's version, but keep YB master's expectation
    that ALTER TABLE succeeds.
- yb_pg_select.out:
  - YB master a913524 makes changes
    that are not relevant to pg15.  Discard the master changes.
- yb_pg_index_including.sql: (see yb_pg_index_including.out)
- pg_hint_plan.c:
  - YB master 5523770 modifies
    get_query_string which no longer exists.  Disregard the master
    change.  See the YB master commit message's pg15 note for more
    detail.
- pg_hint_plan/yb_schedule:
  - YB master 5523770 adds new test
    yb_hint_table at the end.  YB pg15
    4c9db48 changes the other tests
    greatly.  Do both.
- indexam.c:
  - yb_index_update: YB master f0a5db7
    adds this function containing usage of rd_amroutine.  Upstream PG
    346ed70b0ad7efc574711a97812692dab4542712 renames rd_amroutine to
    rd_indam.  Change it for this new usage as well.
- yb_alter_table.out:
  - YB master 24a5af0 adds tests.
    Update constraint violation error messages according to upstream PG
    05f18c6b6b6e4b44302ee20a042cedc664532aa2.
- yb_alter_table_rewrite.out:
  - YB master 2ac2e98 adds tests.
    Update various error messages according to upstream PG
    8e599897ca20fe31cb58fad0b401d7e317235024 and
    05f18c6b6b6e4b44302ee20a042cedc664532aa2.
- yb_pg_alter_table.out: (same as yb_alter_table.out)
- yb_pg_create_index.out:
  - YB master 2ac2e98 adds tests.  YB
    pg15 5e40db0 makes this test run
    with yb_use_hash_splitting_by_default=false, so update \d output
    accordingly.
- yb_pg_foreign_data.sql:
  - Remove the comment "\\ -- YB: output differs with the original test
    due to failed ALTER TABLE above" (see yb_pg_foreign_data.out
    explanation).
- yb_pg_dbms_alert_session_A.out:
  - "advisory locks are not yet implemented": YB master
    5951e18 changes the hint message
    for test queries added by YB pg15.  Update the hint message.
- yb_pg_dbms_alert_session_B.out: (same)
- yb_pg_dbms_alert_session_C.out: (same)
- yb_pg_dbms_pipe_session_A.out: (same)
- yb_pg_dbms_pipe_session_B.out: (same)
- pg15_tests/passing_tests.tsv:
  - XClusterOutboundReplicationGroupParameterized: rename
    XClusterOutboundReplicationGroupTest tests to parameterized
    XClusterOutboundReplicationGroupParameterized due to YB master
    f157e2e.

Test Plan:
pg15_tests are in bad shape:

- some tests have been check failing: this will likely be fixed by
  future YB master 8d228a8.  Tests
  include
  - org.yb.pgsql.TestAlterTableWithConcurrentTxn
  - org.yb.pgsql.TestPgRegressPgIndex
- org.yb.pgsql.TestPgRegressTablespaces is removed from
  passing_tests.tsv by YB pg15 d528e86.
- org.yb.pgsql.TestPgBatch fails altogether but not when tests are run
  individually.

In the interest of time, don't deal with them for now.

Jenkins: rebase: pg15

Reviewers: tfoucher

Reviewed By: tfoucher

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D38252
  • Loading branch information
jaki committed Sep 21, 2024
2 parents d528e86 + 9ae7667 commit 62d1237
Show file tree
Hide file tree
Showing 446 changed files with 12,551 additions and 3,913 deletions.
2 changes: 2 additions & 0 deletions .github/vale-styles/Yugabyte/spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ checksumming
CIDRs
Citrix
Citus
CLion
clonable
Cloudwatch
CMake
Expand Down Expand Up @@ -320,6 +321,7 @@ Javafuzz
JavaScript
Jenkins
Jenkinsfile
Jepsen
Jira
jq
jQuery
Expand Down
13 changes: 7 additions & 6 deletions bin/yugabyted
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@ class ControlScript(object):
"--placement_cloud={}".format(self.configs.saved_data.get("cloud_provider")),
"--placement_region={}".format(self.configs.saved_data.get("cloud_region")),
"--placement_zone={}".format(self.configs.saved_data.get("cloud_zone")),
"--use_memory_defaults_optimized_for_ysql=true",
]

if fault_tolerance == "region":
Expand Down Expand Up @@ -3244,8 +3245,9 @@ class ControlScript(object):
os.path.join(self.configs.saved_data.get("data_dir"), "master-info")),
"--master_enable_metrics_snapshotter=true",
"--webserver_port={}".format(self.configs.saved_data.get("master_webserver_port")),
"--default_memory_limit_to_ram_ratio=0.35",
"--instance_uuid_override={}".format(self.configs.saved_data.get("master_uuid")),
"--enforce_tablet_replica_limits=true",
"--split_respects_tablet_replica_limits=true",
]

if self.configs.saved_data.get("secure"):
Expand Down Expand Up @@ -3340,7 +3342,6 @@ class ControlScript(object):
"--tserver_enable_metrics_snapshotter=true",
"--metrics_snapshotter_interval_ms=11000",
"--webserver_port={}".format(self.configs.saved_data.get("tserver_webserver_port")),
"--default_memory_limit_to_ram_ratio=0.6",
"--instance_uuid_override={}".format(self.configs.saved_data.get("tserver_uuid")),
"--start_redis_proxy=false",
"--placement_uuid={}".format(self.configs.saved_data.get("placement_uuid")),
Expand Down Expand Up @@ -5632,7 +5633,7 @@ class ControlScript(object):
def callhome(self):
if self.configs.saved_data.get("callhome"):
try:
url = "http://diagnostics.yugabyte.com"
url = "https://diagnostics.yugabyte.com"
headers = {
"Content-Type": "application/json",
"User-Agent": "Mozilla",
Expand Down Expand Up @@ -7158,9 +7159,9 @@ class ControlScript(object):

self.configs.saved_data["ca_cert_file_path"] = os.path.join(args.certs_dir,
"ca.crt")
if args.enable_pg_parity_tech_preview:
if args.enable_pg_parity_early_access:
self.configs.temp_data["enable_pg_parity"] = \
args.enable_pg_parity_tech_preview
args.enable_pg_parity_early_access

args.background = self.parse_bool(args.background)
if args.ui is not None:
Expand Down Expand Up @@ -7705,7 +7706,7 @@ class ControlScript(object):
"--config", help="{} user configuration file path".format(
SCRIPT_NAME), metavar="")
cur_parser.add_argument(
"--enable_pg_parity_tech_preview", help="Enable PostgreSQL compatibility features."
"--enable_pg_parity_early_access", help="Enable PostgreSQL compatibility features."
" Default value is False.", action="store_true", default=False)

# Hidden commands for development/advanced users
Expand Down
39 changes: 39 additions & 0 deletions build-support/inline_thirdparty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) YugabyteDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations
# under the License.
#

# See the README.md file in src/inline-thirdparty for more information.

dependencies:
- name: usearch
git_url: https://github.com/unum-cloud/usearch
commit: 4fbb56e02aa928a011abdedb66adfef128123e5f
src_dir: include
dest_dir: usearch

- name: fp16
git_url: https://github.com/Maratyszcza/FP16/
commit: 98b0a46bce017382a6351a19577ec43a715b6835
src_dir: include
dest_dir: fp16

- name: hnswlib
git_url: https://github.com/nmslib/hnswlib
commit: 2142dc6f4dd08e64ab727a7bbd93be7f732e80b0
src_dir: hnswlib
dest_dir: hnswlib/hnswlib

- name: simsimd
git_url: https://github.com/ashvardanian/simsimd
src_dir: include
dest_dir: simsimd
tag: v5.1.0
4 changes: 2 additions & 2 deletions docs/config/_default/menus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@
name = "YugabyteDB"
weight = 10
identifier = "yugabytedb"
url = "/stable/"
url = "/preview/"
[home.params]
showSection = true

[[home]]
name = "YugabyteDB Anywhere"
weight = 11
identifier = "yugabytedb-anywhere"
url = "/stable/yugabyte-platform/"
url = "/preview/yugabyte-platform/"
[home.params]
showSection = true

Expand Down
10 changes: 5 additions & 5 deletions docs/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ version_menu_pagelinks = true
sidebar_search_disable = true
ul_show = 1

[[versions]]
url = "/preview"
version = "v2.23 (Preview)"
[[versions]]
url = "/stable"
version = "v2024.1 (STS)"
[[versions]]
url = "/preview"
version = "v2.21 (Preview)"
[[versions]]
url = "/v2.20"
version = "v2.20 (LTS)"
Expand All @@ -74,8 +74,8 @@ version_menu_pagelinks = true
# Custom params, regardless of theme
[yb]
terms_of_service = "https://www.yugabyte.com/terms-of-service/"
preview_version = "v2.21"
preview_version_slug = "stable"
preview_version = "v2.23"
preview_version_slug = "preview"
# To disable heading/title icons for particular page, define `hideHeadingIcon: true` on that page params.
heading_icons = true

Expand Down
12 changes: 6 additions & 6 deletions docs/content/preview/architecture/design-goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ type: docs

## Scalability

YugabyteDB scales out horizontally by adding more nodes to handle increasing data volumes and higher workloads. With YugabyteDB, you can also opt for vertical scaling choosing more powerful infrastructure components. {{<link "../../explore/linear-scalability/">}}
YugabyteDB scales out horizontally by adding more nodes to handle increasing data volumes and higher workloads. With YugabyteDB, you can also opt for vertical scaling choosing more powerful infrastructure components. {{<link dest="../../explore/linear-scalability/">}}

## High Availability

YugabyteDB ensures continuous availability, even in the face of individual node failures or network partitions. YugabyteDB achieves this by replicating data across multiple nodes and implementing failover mechanisms via leader election. {{<link "../../explore/fault-tolerance">}}
YugabyteDB ensures continuous availability, even in the face of individual node failures or network partitions. YugabyteDB achieves this by replicating data across multiple nodes and implementing failover mechanisms via leader election. {{<link dest="../../explore/fault-tolerance">}}

## Fault Tolerance

YugabyteDB is resilient to various types of failures, such as node crashes, network partitions, disk failures, and other hardware or software faults and failure of various fault domains. It can automatically recover from these failures without data loss or corruption. {{<link "../../explore/fault-tolerance">}}
YugabyteDB is resilient to various types of failures, such as node crashes, network partitions, disk failures, and other hardware or software faults and failure of various fault domains. It can automatically recover from these failures without data loss or corruption. {{<link dest="../../explore/fault-tolerance">}}

## Consistency

Expand Down Expand Up @@ -66,7 +66,7 @@ YugabyteDB monitors and automatically re-balances the number of tablet leaders a

## Data locality

YugabyteDB supports colocated tables and databases which enables related data to be kept together on the same node for performance reasons. {{<link "../../explore/colocation">}}
YugabyteDB supports colocated tables and databases which enables related data to be kept together on the same node for performance reasons. {{<link dest="../../explore/colocation">}}

## Security

Expand Down Expand Up @@ -113,7 +113,7 @@ In addition:

## Cassandra compatibility

[YCQL](../../api/ycql/) is a [semi-relational CQL API](../../explore/ycql-language/) that is best suited for internet-scale OLTP and HTAP applications needing massive write scalability and fast queries. YCQL supports distributed transactions, strongly-consistent secondary indexes, and a native JSON column type. YCQL has its roots in the Cassandra Query Language. {{<link "../query-layer">}}
[YCQL](../../api/ycql/) is a [semi-relational CQL API](../../explore/ycql-language/) that is best suited for internet-scale OLTP and HTAP applications needing massive write scalability and fast queries. YCQL supports distributed transactions, strongly-consistent secondary indexes, and a native JSON column type. YCQL has its roots in the Cassandra Query Language. {{<link dest="../query-layer">}}

## Performance

Expand Down Expand Up @@ -143,7 +143,7 @@ YugabyteDB has been designed with several cloud-native principles in mind.

## Kubernetes-ready

YugabyteDB works natively in Kubernetes and other containerized environments as a stateful application. {{<link "../../deploy/kubernetes/">}}
YugabyteDB works natively in Kubernetes and other containerized environments as a stateful application. {{<link dest="../../deploy/kubernetes/">}}

## Open source

Expand Down
Loading

0 comments on commit 62d1237

Please sign in to comment.