Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Alvaro Herrera <alvherre@2ndquadrant.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Tighten the concurrent abort check during decoding.
- 2ce353fc1902 14.0 landed
-
Improve hash_create()'s API for some added robustness.
- b3817f5f7746 14.0 landed
-
Use HASH_BLOBS for xidhash.
- a1b8aa1e4eec 14.0 landed
-
Fix initialization of RelationSyncEntry for streaming transactions.
- 69bd60672af6 14.0 landed
-
Remove unused function declaration in logicalproto.h.
- ddd5f6d2609b 14.0 landed
-
Add additional tests to test streaming of in-progress transactions.
- 58b5ae9d62bd 14.0 landed
-
Fix inline marking introduced in commit 464824323e.
- ac15b499f7f9 14.0 landed
-
Add support for streaming to built-in logical replication.
- 464824323e57 14.0 landed
-
Fix the SharedFileSetUnregister API.
- 4ab77697f67a 14.0 landed
-
Fix comment in procarray.c
- 77c7267c37f7 14.0 cited
-
Suppress compiler warning in non-cassert builds.
- e942af7b8261 14.0 cited
-
Extend the BufFile interface.
- 808e13b282ef 14.0 landed
-
Mark a few logical decoding related variables with PGDLLIMPORT.
- b48cac3b10a0 14.0 landed
-
Implement streaming mode in ReorderBuffer.
- 7259736a6e5b 14.0 landed
-
Extend the logical decoding output plugin API with stream methods.
- 45fdc9738b36 14.0 landed
-
WAL Log invalidations at command end with wal_level=logical.
- c55040ccd017 14.0 landed
-
Immediately WAL-log subtransaction and top-level XID association.
- 0bead9af484c 14.0 landed
-
Allow logical replication to transfer data in binary format.
- 9de77b545313 14.0 cited
-
Only superuser can set sslcert/sslkey in postgres_fdw user mappings
- cebf9d6e6ee1 13.0 cited
-
Track statistics for spilling of changes from ReorderBuffer.
- 9290ad198b15 13.0 landed
-
Add logical_decoding_work_mem to limit ReorderBuffer memory usage.
- cec2edfa7859 13.0 landed
-
logical decoding: process ASSIGNMENT during snapshot build
- bac2fae05c77 13.0 cited
-
Emit invalidations to standby for transactions without xid.
- c6ff84b06a68 9.6.0 cited
Attachments
- 0001-Dilip-s-original.patch (text/x-diff)
I looked at this patchset and it seemed natural to apply 0008 next (adding work_mem to subscriptions). Attached is Dilip's latest version, plus my review changes. This will break the patch tester's logic; sorry about that. What part of this change is what sets the process's logical_decoding_work_mem to the given value? I was unable to figure that out. Is it missing or am I just stupid? Changes: * the patch adds logical_decoding_work_mem SGML, but that has already been applied (cec2edfa7859); remove dupe. * parse_subscription_options() comment says that it will raise an error if a caller does not pass the pointer for an option but option list specifies that option. It does not really implement that behavior (an existing problem): instead, if the pointer is not passed, the option is ignored. Moreover, this new patch continued to fail to handle things as the comment says. I decided to implement the documented behavior instead; it's now inconsistent with how the other options are implemented. I think we should fix the other options to behave as the comment says, because it's a more convenient API; if we instead opted to update the code comment to match the code, each caller would have to be checked to verify that the correct options are passed, which is pointless and error prone. * the parse_subscription_options API is a mess. I reordered the arguments a little bit; also change the argument layout in callers so that each caller is grouped more sensibly. Also added comments to simplify reading the argument lists. I think this could be fixed by using an ad-hoc struct to pass in and out. Didn't get around to doing that, seems an unrelated potential improvement. * trying to do own range checking in pgoutput and subscriptioncmds.c seems pointless and likely to get out of sync with guc.c. Simpler is to call set_config_option() to verify that the argument is in range. (Note a further problem in the patch series: the range check in subscriptioncmds.c is only added in patch 0009). * parsing integers using scanint8() seemed weird (error messages there do not correspond to what we want). After a couple of false starts, I decided to rely on guc.c's set_config_option() followed by parse_int(). That also has the benefit that you can give it units. * psql \dRs+ should display the work_mem; patch failed to do that. Added. Unit display is done by pg_size_pretty(), which might be different from what guc.c does, but I think it works OK. It's the first place where we use pg_size_pretty to show a memory limit, however. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services