forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#22449] CDCSDK: Introduce support for wal2json plugin
Summary: This diff introduces the support for `wal2json` output plugin with the PG compatible logical replication support. Key points: # A commit from PG (postgres/postgres@87c1dd2) was needed. This will be added in a separate revision (https://phorge.dev.yugabyte.com/D35740) # Like test_decoding this plugin does not send the relation object. So the schema refresh callback is a NOOP. # The sql and expected files from the wal2json repo and the corresponding PgRegressTests have not been added since it requires support for PG functions such as `pg_logical_slot_get_changes` which is currently unsupported. They will be imported separately as part of issue: yugabyte#22687 Jira: DB-11366 Test Plan: Jenkins: test regex: .*ReplicationSlot.* ./yb_build.sh --java-test 'org.yb.pgsql.TestPgReplicationSlot#testWithWal2JsonPlugin' Manually tested with pg_recvlogical Reviewers: stiwary, asrinivasan, skumar Reviewed By: stiwary, skumar Subscribers: yql, ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D35521
- Loading branch information
1 parent
b795d98
commit 22e43ac
Showing
7 changed files
with
3,569 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Generated subdirectories | ||
/log/ | ||
/results/ | ||
/output_iso/ | ||
/tmp_check/ | ||
/tmp_check_iso/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2013-2024, Euler Taveira de Oliveira | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
* Neither the name of the Euler Taveira de Oliveira nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# contrib/wal2json/Makefile | ||
|
||
MODULES = wal2json | ||
PGFILEDESC = "wal2json - JSON output plugin for changeset extraction" | ||
|
||
REGRESS = cmdline insert1 update1 update2 update3 update4 delete1 delete2 \ | ||
delete3 delete4 savepoint specialvalue toast bytea message typmod \ | ||
filtertable selecttable include_timestamp include_lsn include_xids \ | ||
include_domain_data_type truncate type_oid actions position default \ | ||
pk rename_column numeric_data_types_as_string | ||
|
||
EXTRA_CLEAN = $(pg_regress_clean_files) | ||
|
||
ifdef USE_PGXS | ||
PG_CONFIG = pg_config | ||
PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
include $(PGXS) | ||
else | ||
subdir = contrib/wal2json | ||
top_builddir = ../.. | ||
include $(top_builddir)/src/Makefile.global | ||
include $(top_srcdir)/contrib/contrib-global.mk | ||
endif | ||
|
||
# message API is available in 9.6+ | ||
ifneq (,$(findstring $(MAJORVERSION),9.4 9.5)) | ||
REGRESS := $(filter-out message, $(REGRESS)) | ||
endif | ||
|
||
# truncate API is available in 11+ | ||
ifneq (,$(findstring $(MAJORVERSION),9.4 9.5 9.6 10)) | ||
REGRESS := $(filter-out truncate, $(REGRESS)) | ||
endif | ||
|
||
# actions API is available in 11+ | ||
# this test should be executed in prior versions, however, truncate will fail. | ||
ifneq (,$(findstring $(MAJORVERSION),9.4 9.5 9.6 10)) | ||
REGRESS := $(filter-out actions, $(REGRESS)) | ||
endif | ||
|
||
# make installcheck | ||
# | ||
# It can be run but you need to add the following parameters to | ||
# postgresql.conf: | ||
# | ||
# wal_level = logical | ||
# max_replication_slots = 10 | ||
# | ||
# Also, you should start the server before executing it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
wal_level = logical | ||
max_replication_slots = 4 |
Oops, something went wrong.