- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit29d0a77

Amit Kapila
Migrate logical slots to the new node during an upgrade.
While reading information from the old cluster, a list of logicalslots is fetched. At the later part of upgrading, pg_upgrade revisits thelist and restores slots by executing pg_create_logical_replication_slot()on the new cluster. Migration of logical replication slots is onlysupported when the old cluster is version 17.0 or later.If the old node has invalid slots or slots with unconsumed WAL records,the pg_upgrade fails. These checks are needed to prevent data loss.The significant advantage of this commit is that it makes it easy tocontinue logical replication even after upgrading the publisher node.Previously, pg_upgrade allowed copying publications to a new node. Withthis patch, adjusting the connection string to the new publisher willcause the apply worker on the subscriber to connect to the new publisherautomatically. This enables seamless continuation of logical replication,even after an upgrade.Author: Hayato Kuroda, Hou ZhijieReviewed-by: Peter Smith, Bharath Rupireddy, Dilip Kumar, Vignesh C, Shlok KyalDiscussion:http://postgr.es/m/TYAPR01MB58664C81887B3AF2EB6B16E3F5939@TYAPR01MB5866.jpnprd01.prod.outlook.comDiscussion:http://postgr.es/m/CAA4eK1+t7xYcfa0rEQw839=b2MzsfvYDPz3xbD+ZqOdP3zpKYg@mail.gmail.com1 parentbddc2f7 commit29d0a77
File tree
18 files changed
+927
-27
lines changed- doc/src/sgml/ref
- src
- backend
- replication
- logical
- utils/adt
- bin/pg_upgrade
- t
- include
- catalog
- replication
- tools/pgindent
18 files changed
+927
-27
lines changedLines changed: 76 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
383 | 383 |
| |
384 | 384 |
| |
385 | 385 |
| |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
386 | 459 |
| |
387 | 460 |
| |
388 | 461 |
| |
| |||
650 | 723 |
| |
651 | 724 |
| |
652 | 725 |
| |
653 |
| - | |
654 |
| - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
655 | 729 |
| |
656 | 730 |
| |
657 | 731 |
| |
|
Lines changed: 39 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
600 | 600 |
| |
601 | 601 |
| |
602 | 602 |
| |
603 |
| - | |
604 |
| - | |
605 |
| - | |
606 |
| - | |
607 |
| - | |
608 |
| - | |
| 603 | + | |
| 604 | + | |
609 | 605 |
| |
610 | 606 |
| |
611 | 607 |
| |
| |||
622 | 618 |
| |
623 | 619 |
| |
624 | 620 |
| |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
625 | 641 |
| |
626 | 642 |
| |
627 | 643 |
| |
| |||
1286 | 1302 |
| |
1287 | 1303 |
| |
1288 | 1304 |
| |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1292 | 1322 |
|
Lines changed: 75 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
| |||
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| 45 | + | |
44 | 46 |
| |
45 | 47 |
| |
46 | 48 |
| |
| |||
1949 | 1951 |
| |
1950 | 1952 |
| |
1951 | 1953 |
| |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + |
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1423 | 1423 |
| |
1424 | 1424 |
| |
1425 | 1425 |
| |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1426 | 1440 |
| |
1427 | 1441 |
| |
1428 | 1442 |
| |
|
Lines changed: 44 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
261 | 262 |
| |
262 | 263 |
| |
263 | 264 |
| |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + |
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 |
| |
7 | 10 |
| |
8 | 11 |
| |
|
0 commit comments
Comments
(0)