mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Commit 216a784829 introduced parallel apply workers, allowing multiple
processes to share a replication origin. To support this,
replorigin_session_setup() was extended to accept a pid argument
identifying the process using the origin.
This commit exposes that capability through the SQL interface function
pg_replication_origin_session_setup() by adding an optional pid parameter.
This enables multiple processes to coordinate replication using the same
origin when using SQL-level replication functions.
This change allows the non-builtin logical replication solutions to
implement parallel apply for large transactions.
Additionally, an existing internal error was made user-facing, as it can
now be triggered via the exposed SQL API.
Author: Doruk Yilmaz <doruk@mixrank.com>
Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Discussion: https://postgr.es/m/CAMPB6wfe4zLjJL8jiZV5kjjpwBM2=rTRme0UCL7Ra4L8MTVdOg@mail.gmail.com
Discussion: https://postgr.es/m/CAE2gYzyTSNvHY1+iWUwykaLETSuAZsCWyryokjP6rG46ZvRgQA@mail.gmail.com
		
	
		
			
				
	
	
		
			81 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Meson
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Meson
		
	
	
	
	
	
# Copyright (c) 2022-2025, PostgreSQL Global Development Group
 | 
						|
 | 
						|
test_decoding_sources = files(
 | 
						|
  'test_decoding.c',
 | 
						|
)
 | 
						|
 | 
						|
if host_system == 'windows'
 | 
						|
  test_decoding_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
 | 
						|
    '--NAME', 'test_decoding',
 | 
						|
    '--FILEDESC', 'test_decoding - example of a logical decoding output plugin',])
 | 
						|
endif
 | 
						|
 | 
						|
test_decoding = shared_module('test_decoding',
 | 
						|
  test_decoding_sources,
 | 
						|
  kwargs: contrib_mod_args,
 | 
						|
)
 | 
						|
contrib_targets += test_decoding
 | 
						|
 | 
						|
tests += {
 | 
						|
  'name': 'test_decoding',
 | 
						|
  'sd': meson.current_source_dir(),
 | 
						|
  'bd': meson.current_build_dir(),
 | 
						|
  'regress': {
 | 
						|
    'sql': [
 | 
						|
      'ddl',
 | 
						|
      'xact',
 | 
						|
      'rewrite',
 | 
						|
      'toast',
 | 
						|
      'permissions',
 | 
						|
      'decoding_in_xact',
 | 
						|
      'decoding_into_rel',
 | 
						|
      'binary',
 | 
						|
      'prepared',
 | 
						|
      'replorigin',
 | 
						|
      'time',
 | 
						|
      'messages',
 | 
						|
      'spill',
 | 
						|
      'slot',
 | 
						|
      'truncate',
 | 
						|
      'stream',
 | 
						|
      'stats',
 | 
						|
      'twophase',
 | 
						|
      'twophase_stream',
 | 
						|
    ],
 | 
						|
    'regress_args': [
 | 
						|
      '--temp-config', files('logical.conf'),
 | 
						|
    ],
 | 
						|
    # Disabled because these tests require "wal_level=logical", which
 | 
						|
    # typical runningcheck users do not have (e.g. buildfarm clients).
 | 
						|
    'runningcheck': false,
 | 
						|
  },
 | 
						|
  'isolation': {
 | 
						|
    'specs': [
 | 
						|
      'mxact',
 | 
						|
      'delayed_startup',
 | 
						|
      'ondisk_startup',
 | 
						|
      'catalog_change_snapshot',
 | 
						|
      'concurrent_ddl_dml',
 | 
						|
      'oldest_xmin',
 | 
						|
      'snapshot_transfer',
 | 
						|
      'subxact_without_top',
 | 
						|
      'concurrent_stream',
 | 
						|
      'twophase_snapshot',
 | 
						|
      'slot_creation_error',
 | 
						|
      'skip_snapshot_restore',
 | 
						|
      'invalidation_distribution',
 | 
						|
      'parallel_session_origin',
 | 
						|
    ],
 | 
						|
    'regress_args': [
 | 
						|
      '--temp-config', files('logical.conf'),
 | 
						|
    ],
 | 
						|
    # see above
 | 
						|
    'runningcheck': false,
 | 
						|
  },
 | 
						|
  'tap': {
 | 
						|
    'tests': [
 | 
						|
      't/001_repl_stats.pl',
 | 
						|
    ],
 | 
						|
  },
 | 
						|
}
 |