forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit40e2e5e
committed
Introduce framework for parallelizing various pg_upgrade tasks.
A number of pg_upgrade steps require connecting to every databasein the cluster and running the same query in each one. When thereare many databases, these steps are particularly time-consuming,especially since they are performed sequentially, i.e., we connectto a database, run the query, and process the results before movingon to the next database.This commit introduces a new framework that makes it easy toparallelize most of these once-in-each-database tasks by processingmultiple databases concurrently. This framework manages a set ofslots that follow a simple state machine, and it uses libpq'sasynchronous APIs to establish the connections and run the queries.The --jobs option is used to determine the number of slots to use.To use this new task framework, callers simply need to provide thequery and a callback function to process its results, and theframework takes care of the rest. A more complete description isprovided at the top of the new task.c file.None of the eligible once-in-each-database tasks are converted touse this new framework in this commit. That will be done viaseveral follow-up commits.Reviewed-by: Jeff Davis, Robert Haas, Daniel Gustafsson, Ilya Gladyshev, Corey HuinkerDiscussion:https://postgr.es/m/20240516211638.GA1688936%40nathanxps131 parentd891c49 commit40e2e5e
File tree
6 files changed
+474
-3
lines changed- doc/src/sgml/ref
- src
- bin/pg_upgrade
- tools/pgindent
6 files changed
+474
-3
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
121 |
| - | |
| 121 | + | |
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
| |||
587 | 587 |
| |
588 | 588 |
| |
589 | 589 |
| |
590 |
| - | |
591 |
| - | |
| 590 | + | |
| 591 | + | |
592 | 592 |
| |
593 | 593 |
| |
594 | 594 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
494 | 494 |
| |
495 | 495 |
| |
496 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + |
0 commit comments
Comments
(0)