Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-03-30 Thread Dilip Kumar
mitted v6 instead. Let's see > what breaks... > There was a duplicate error check for the invalid createdb strategy option in the test case, although it would not create any issue but it is duplicate so I have fixed it in the attached patch. -- Regards, Dilip Kumar EnterpriseDB: http://ww

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-03-30 Thread Dilip Kumar
ngle test for it. I will add tests for both of these cases and send the patch. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-03-31 Thread Dilip Kumar
On Thu, Mar 31, 2022 at 9:46 AM Dilip Kumar wrote: > > On Thu, Mar 31, 2022 at 5:07 AM Andres Freund wrote: > > > > Hi, > > > > On 2022-03-29 11:55:05 -0400, Robert Haas wrote: > > > I committed v6 instead. > > > > I was just discussing t

Re: should vacuum's first heap pass be read-only?

2022-03-31 Thread Dilip Kumar
vacuuming certain partitions when we go for global index vacuuming we don't want to rescan all the partitions to get the same dead items) b) and even without global indexes there are advantages of storing dead items in the conveyor belt as explained in my previous paragraph. So I think it is worth

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-04-01 Thread Dilip Kumar
d verify it then they can do so. But with the current tests in mind the way I got it in the attached patch has less duplicate code so I preferred it this way. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com From a672a27a9e502331a7c4ca2a16f3f660c8ed3fcd Mon Sep 17 00:00:00 2001 F

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2022-04-04 Thread Dilip Kumar
there we don't have a memory context to > reset afaics. Oddly enough, it sure looks like we have an existing version of > this bug in the file-copy path? Yeah, I see that the createdb() and dbase_redo() had this existing problem and with this patch we have created a few more such oc

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2022-04-04 Thread Dilip Kumar
so that we do not create an unnecessary directory under the tablespace where we do not have any data to be copied. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: should vacuum's first heap pass be read-only?

2022-04-05 Thread Dilip Kumar
On Fri, Apr 1, 2022 at 11:34 PM Robert Haas wrote: > > On Fri, Apr 1, 2022 at 12:08 AM Dilip Kumar wrote: > > After thinking more about this I see there is some value of > > remembering the dead tids in the conveyor belt. Basically, the point > > is if there are multip

Re: Support logical replication of DDLs

2022-04-13 Thread Dilip Kumar
ser has to create and what will be replicated using DDL replication? Suppose the user takes a dump and copies all the schema and then creates the subscription, then how we are we going to handle the DDL concurrent to the subscription command? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Support logical replication of DDLs

2022-04-14 Thread Dilip Kumar
On Fri, Apr 8, 2022 at 4:30 PM Amit Kapila wrote: > > On Tue, Mar 29, 2022 at 9:47 AM Dilip Kumar wrote: > > > > > > The idea is to force skipping any direct data population (which can > > > potentially cause data inconsistency on the subscriber) > > > i

Re: Stabilizing the test_decoding checks, take N

2022-04-18 Thread Dilip Kumar
be easily reproducible every time. If this happens to be true then > I think your suggestion related to increasing autovacuum_naptime would > work. > I will try to reproduce this, maybe by reducing the autovacuum_naptime or parallelly running some script that continuously performs DDL-only transactions. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Stabilizing the test_decoding checks, take N

2022-04-18 Thread Dilip Kumar
On Mon, Apr 18, 2022 at 3:29 PM Dilip Kumar wrote: > > This needs to be verified once by doing some manual testing as it may > not be easily reproducible every time. If this happens to be true then > I think your suggestion related to increasing autovacuum_naptime would > work. &

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-10-19 Thread Dilip Kumar
m under the same buffer pool and comparing against relation pages for victim buffer selection might cause different problems. But anyway I would discuss those points maybe in that thread. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-10-24 Thread Dilip Kumar
On Tue, Oct 24, 2023 at 9:34 PM Alvaro Herrera wrote: > > On 2023-Oct-11, Dilip Kumar wrote: > > > In my last email, I forgot to give the link from where I have taken > > the base path for dividing the buffer pool in banks so giving the same > > here[1]. And looking

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-10-25 Thread Dilip Kumar
On Wed, Oct 25, 2023 at 5:58 PM Amit Kapila wrote: > > On Fri, Oct 20, 2023 at 9:40 AM Dilip Kumar wrote: > > > > On Sat, Oct 14, 2023 at 9:43 AM Amit Kapila wrote: > > > > > > This and other results shared by you look promising. Will there be any > >

Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE

2023-11-04 Thread Dilip Kumar
pages for the actual backend and the worker? I mean here for the backend you are showing lossy pages only if it is > 0 whereas for workers we are showing 0 lossy pages as well. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-05 Thread Dilip Kumar
On Sun, Nov 5, 2023 at 1:37 AM Andrey M. Borodin wrote: > On 30 Oct 2023, at 09:20, Dilip Kumar wrote: > > changed the logic of SlruAdjustNSlots() in 0002, such that now it > starts with the next power of 2 value of the configured slots and > keeps doubling the number of banks

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-06 Thread Dilip Kumar
On Mon, Nov 6, 2023 at 1:05 PM Andrey M. Borodin wrote: > > On 6 Nov 2023, at 09:09, Dilip Kumar wrote: > > > > > >> Having hashtable to find SLRU page in the buffer IMV is too slow. Some > >> comments on this approach can be found here [0]. > >> I&

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-06 Thread Dilip Kumar
k partitioning. Simplehash has not, AFAIK. Yeah, Simplehash doesn't have partitioning so with simple hash we will be stuck with the centralized control lock that is one of the main problems trying to solve here. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-07 Thread Dilip Kumar
rom this. Although I don't have any number which proves this. Currently, I want to focus on all the base patches and keep this patch as add on and later if we find its useful and want to pursue this then we will see how to make it better readable. > > Subject: [PATCH v4 5/5] Ensure slru buffer slots are in multiple of numbe of > partitions > > I think the 0005 patch can be merged to 0001. Yeah in the next version, it is done that way. Planning to post end of the day. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-09 Thread Dilip Kumar
On Thu, Nov 9, 2023 at 9:39 PM Robert Haas wrote: > > On Wed, Nov 8, 2023 at 6:41 AM Dilip Kumar wrote: > > Here is the updated version of the patch, here I have taken the > > approach suggested by Andrey and I discussed the same with Alvaro > > offlist and he also agre

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-09 Thread Dilip Kumar
; them alone and only adjust the one with which they have a performance > problems; it's not going to be the same one for everybody. +1 -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: trying again to get incremental backup

2023-11-10 Thread Dilip Kumar
es < 0) + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not write file \"%s\": %m", + FilePathName(io->file; /could not write file/ could not read file 8. +/* + * Comparator to sort a List of WalSummaryFile objects by start_lsn. + */ +static int +ListComparatorForWalSummaryFiles(const ListCell *a, const ListCell *b) +{ -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: trying again to get incremental backup

2023-11-13 Thread Dilip Kumar
On Tue, Nov 14, 2023 at 12:52 AM Robert Haas wrote: > > On Fri, Nov 10, 2023 at 6:27 AM Dilip Kumar wrote: > > - I think 0001 looks good improvement irrespective of the patch series. > > OK, perhaps that can be independently committed, then, if nobody objects. > > Tha

Re: trying again to get incremental backup

2023-11-14 Thread Dilip Kumar
already returning 'BlockRefTableEntry' then why would it need to set an extra '*limit_block' out parameter which it is actually reading from the entry itself? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-16 Thread Dilip Kumar
> 64k buffers, since useful values are below a couple thousand anyhow. I agree, that allowing xact_buffers to grow beyond 65536 up to the slru.h-defined limit of 131072 is not that bad, so I will change that in the next version. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-18 Thread Dilip Kumar
so I'm doubly hesitant to go > without any testing here. Maybe it'd be possible to use Michael > Paquier's injection points somehow? Sorry, but I am not aware of "Michael Paquier's injection" Is it something already in the repo? Can you redirect me to some of

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-19 Thread Dilip Kumar
ther external functions starting with "SimpleLruGet", are you fine with this name? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-20 Thread Dilip Kumar
On Fri, Nov 17, 2023 at 7:28 PM Alvaro Herrera wrote: > > On 2023-Nov-17, Dilip Kumar wrote: I think I need some more clarification for some of the review comments > > On Thu, Nov 16, 2023 at 3:11 PM Alvaro Herrera > > wrote: > > > > > > I just no

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-20 Thread Dilip Kumar
On Mon, Nov 20, 2023 at 2:37 PM Andrey M. Borodin wrote: > > On 20 Nov 2023, at 13:51, Dilip Kumar wrote: > > > > 2) Do we really need one separate lwlock tranche for each SLRU? > > > > IMHO if we use the same lwlock tranche then the wait event will show > >

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-22 Thread Dilip Kumar
On Tue, Nov 21, 2023 at 2:03 PM Dilip Kumar wrote: > > On Mon, Nov 20, 2023 at 4:42 PM Dilip Kumar wrote: > > > > On Mon, Nov 20, 2023 at 2:37 PM Andrey M. Borodin > > wrote: > > > > > > On 20 Nov 2023, at 13:51, Dilip Kumar wrote: > > >

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-23 Thread Dilip Kumar
On Thu, Nov 23, 2023 at 11:34 AM Dilip Kumar wrote: > > Note: With this testing, we have found a bug in the bank-wise > approach, basically we are clearing a procglobal->clogGroupFirst, even > before acquiring the bank lock that means in most of the cases there > will be a sing

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-29 Thread Dilip Kumar
async.h:15 > > error: src/include/commands/async.h: patch does not apply > > Yeah, this patch series conflicts with today's commit 4ed8f0913bfd. I will send a rebased version by tomorrow. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-12-05 Thread Dilip Kumar
he queue of the non-transactional sequence change so that while sending it to downstream whenever it is necessary we will change the historic snapshot? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
On Wed, Dec 6, 2023 at 11:12 AM Dilip Kumar wrote: > > On Sun, Dec 3, 2023 at 11:22 PM Tomas Vondra > wrote: > > I was also wondering what happens if the sequence changes are transactional but somehow the snap builder state changes to SNAPBUILD_FULL_SNAPSHOT in between pr

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
al sequence changes in a separate queue in the order they arrive and as soon as we process the next commit we will process all the non-transactional changes at that time. Do you see issue with that? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
On Wed, Dec 6, 2023 at 7:17 PM Tomas Vondra wrote: > > On 12/6/23 12:05, Dilip Kumar wrote: > > On Wed, Dec 6, 2023 at 3:36 PM Amit Kapila wrote: > >> > >>> Why can't we use the same concept of > >>> SnapBuildDistributeNewCatalogSnapshot(),

Re: logical decoding and replication of sequences, take 2

2023-12-06 Thread Dilip Kumar
bility of the upcoming operation in the same transaction, but that's not an issue because if some of the changes of this transaction are seen when snapbuild state < SNAPBUILD_FULL_SNAPSHOT then this transaction has to get committed before the state change to SNAPBUILD_CONSISTENT_SNAPSHOT i.

Re: Adding facility for injection points (or probe points?) for more advanced tests

2023-12-10 Thread Dilip Kumar
b4_%3DzNoKU%2B8FP-S6zpv-r4Gm-Y%2BQ%40mail.gmail.com -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: trying again to get incremental backup

2023-12-10 Thread Dilip Kumar
ould not initiate base backup: ERROR: manifest requires WAL from final timeline 1 ending at 0/6F8, but this backup starts at 0/628 pg_basebackup: removing data directory "d1" -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: trying again to get incremental backup

2023-12-10 Thread Dilip Kumar
On Mon, Dec 11, 2023 at 11:44 AM Dilip Kumar wrote: > > On Tue, Dec 5, 2023 at 11:40 PM Robert Haas wrote: > > > > On Mon, Dec 4, 2023 at 3:58 PM Robert Haas wrote: > > > Considering all this, what I'm inclined to do is go and put > > > UPLOAD_MANIFE

Re: Synchronizing slots from primary to standby

2023-12-11 Thread Dilip Kumar
ould be the user's responsibility. I mean if the user has set 'standby_slot_names' on standby then let standby also wait for cascading standby to sync their slots? Is there any issue with that behavior? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Synchronizing slots from primary to standby

2023-12-11 Thread Dilip Kumar
On Mon, Dec 11, 2023 at 2:21 PM shveta malik wrote: > > On Mon, Dec 11, 2023 at 1:47 PM Dilip Kumar wrote: > > > > On Fri, Dec 8, 2023 at 2:36 PM Amit Kapila wrote: > > > > > > On Wed, Dec 6, 2023 at 4:53 PM shveta malik > > > wrote: > > >

Re: Improve eviction algorithm in ReorderBuffer

2023-12-11 Thread Dilip Kumar
if we frequently select many of these transactions to come under memory limit instead of selecting a couple of large transactions which are consuming 8-9%? > > As a side note, the idea (c) mentioned in the comment, evicting > multiple transactions at once to free a given portion of the memory, > would also help in avoiding back and forth the memory threshold. It's > also worth considering. Yes, I think it is worth considering. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Adding facility for injection points (or probe points?) for more advanced tests

2023-12-11 Thread Dilip Kumar
On Mon, Dec 11, 2023 at 3:14 PM Michael Paquier wrote: > > On Mon, Dec 11, 2023 at 11:09:45AM +0530, Dilip Kumar wrote: > > I haven't specifically done a review or testing of this patch, but I > > have used this for testing the CLOG group update code with my > > SLRU

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-12 Thread Dilip Kumar
xceptional case we are checking the respective bank lock for each page and if that exception occurred we will release the old bank lock and acquire a new lock. This case might not be performant because now it is possible that after getting the lock leader might need to wait again on another bank

Re: Improve eviction algorithm in ReorderBuffer

2023-12-12 Thread Dilip Kumar
ween the largest and smallest transaction in this list are not very significant. And remaining in the small transaction list and from the small transaction list we can choose to spill multiple transactions at a time. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-12-13 Thread Dilip Kumar
ate does not reach FULL just add the sequence relids to the hash, I mean that hash is only maintained for deciding whether the sequence is changed in that transaction or not. So no adding such relids to hash seems like a root cause of the issue. Honestly, I haven't analyzed this idea in det

Re: logical decoding and replication of sequences, take 2

2023-12-13 Thread Dilip Kumar
On Thu, Dec 14, 2023 at 12:31 PM Ashutosh Bapat wrote: > > On Thu, Dec 14, 2023 at 10:53 AM Dilip Kumar wrote: > > > > > > > > > > > It is correct that we can make a wrong decision about whether a change > > > is transactional or non-transact

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-14 Thread Dilip Kumar
4| 512/1024| 44 patch-2 | 1024| 512/1024| 72 [1] https://www.postgresql.org/message-id/flat/e46cdea96979545b2d8a13b451d8b1ce61dc7238.camel%40postgrespro.ru#0ed2cad11470825d464093fe6b8ef6a3 -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-14 Thread Dilip Kumar
On Thu, Dec 14, 2023 at 4:36 PM Dilip Kumar wrote: > > On Wed, Dec 13, 2023 at 5:49 PM Andrey M. Borodin > wrote: > > > > On 12 Dec 2023, at 18:28, Alvaro Herrera wrote: > > > > > > Andrey, do you have any stress tests or anything else that you use

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-18 Thread Dilip Kumar
client counts. So as per my understanding by distributing the SLRU locks there are scenarios where we will not need group update anymore but OTOH there are also scenarios where we will still benefit from the group update. [1] https://www.postgresql.org/message-id/CAFiTN-u-XEzhd%3DhNGW586f

Re: index prefetching

2023-12-20 Thread Dilip Kumar
forward direction? + */ + for (int i = 1; i < PREFETCH_SEQ_PATTERN_BLOCKS; i++) Correct, I think if we fetch this forward it will have an advantage with memory prefetching. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2024-01-02 Thread Dilip Kumar
want to rethink > the way the SLRU is extended -- page at a time wouldn't really make > sense, but preallocating an entire file might. Yeah, this is indeed an interesting idea. So I think if we are interested in working in this direction maybe this can be submitted in a different thread, IMHO. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Synchronizing slots from primary to standby

2024-01-03 Thread Dilip Kumar
usage then we can expand the behavior by providing an additional GUC with dbname. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Adding facility for injection points (or probe points?) for more advanced tests

2024-01-05 Thread Dilip Kumar
On Tue, Dec 12, 2023 at 4:15 PM Michael Paquier wrote: > > On Tue, Dec 12, 2023 at 10:27:09AM +0530, Dilip Kumar wrote: > > Oops, I only included the code changes where I am adding injection > > points and some comments to verify that, but missed the actual test > > file.

Re: Synchronizing slots from primary to standby

2024-01-05 Thread Dilip Kumar
ING, and ENABLED. The state transition process + * between these values is the same as the two_phase option (see TWO_PHASE + * TRANSACTIONS for details). -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Synchronizing slots from primary to standby

2024-01-07 Thread Dilip Kumar
On Fri, Jan 5, 2024 at 5:45 PM Amit Kapila wrote: > > On Fri, Jan 5, 2024 at 4:25 PM Dilip Kumar wrote: > > > > On Fri, Jan 5, 2024 at 8:59 AM shveta malik wrote: > > > > > I was going the the patch set again, I have a question. The below > > comments

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2024-01-08 Thread Dilip Kumar
nk there is a problem with multiple processes getting the lock? I mean they are modifying different CLOG pages so that can be done concurrently right? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Synchronizing slots from primary to standby

2024-01-09 Thread Dilip Kumar
replication slot, which allows informing the primary about the xmin and + * catalog_xmin values on the standby. I do not like capitalizing the first letter of the 'hot_standby_feedback' which is a GUC parameter -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: New WAL record to detect the checkpoint redo location

2023-08-30 Thread Dilip Kumar
On Wed, Aug 30, 2023 at 1:03 PM Michael Paquier wrote: > > On Mon, Aug 28, 2023 at 01:47:18PM +0530, Dilip Kumar wrote: > > I removed this mainly because now in other comments[1] where we are > > introducing this new CHECKPOINT_REDO record we are explaining the > > p

Re: New WAL record to detect the checkpoint redo location

2023-08-30 Thread Dilip Kumar
On Thu, Aug 31, 2023 at 9:36 AM Michael Paquier wrote: > > On Wed, Aug 30, 2023 at 04:51:19PM +0530, Dilip Kumar wrote: > > Your suggestions LGTM so modified accordingly > > I have been putting my HEAD on this patch for a few hours, reviewing > the surroundings, and some

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-31 Thread Dilip Kumar
, > >> but I plan to commit both patches sometime today. > > > > Thanks! I'm glad your committing the patches, and I approve of you > > spending way too much time on the commit message. :-) > > Committed. Sorry, I didn't notice this thread earlier. The new

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-31 Thread Dilip Kumar
the slots. If it is printing the name of the slots then shouldn't it be printing all the slots' names or it should just say that there existing slots on the new cluster without giving any names? And if we are planning for option 2 i.e. not printing the name then better to put LIMIT 1 at the end of the query. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-31 Thread Dilip Kumar
ting the name of the slots then shouldn't it be > > printing all the slots' names or it should just say that there > > existing slots on the new cluster without giving any names? And if we > > are planning for option 2 i.e. not printing the name then better to > > put LIMIT 1 at the end of the query. > > I'm planning to change that the number of slots are reported by using > count(*). Yeah, that seems a better option. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-31 Thread Dilip Kumar
On Fri, Sep 1, 2023 at 9:47 AM Dilip Kumar wrote: > > On Thu, Aug 31, 2023 at 7:56 PM Hayato Kuroda (Fujitsu) > wrote: > Some more comments on 0002 1. + conn = connectToServer(&new_cluster, "template1"); + + prep_status("Checking for logical replication slots"

Re: Impact of checkpointer during pg_upgrade

2023-09-02 Thread Dilip Kumar
very rare that some of the segments are getting dropped just during the upgrade time and that too from the old cluster so in such cases not migrating the slots which are invalidated should be fine no? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-03 Thread Dilip Kumar
e: "pg_catalog.pg_largeobject", reloid: 2613, reltblspace: "" > relname: "pg_catalog.pg_largeobject_loid_pn_index", reloid: 2683, > reltblspace: "" > Logical replication slots within the database: > slotname: "old1", plugin: "test_decoding", two_phase: 0 > slotname: "old2", plugin: "test_decoding", two_phase: 0 > slotname: "old3", plugin: "test_decoding", two_phase: 0 Yeah this looks good now. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Impact of checkpointer during pg_upgrade

2023-09-03 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 8:41 AM Amit Kapila wrote: > > On Sat, Sep 2, 2023 at 6:12 PM Dilip Kumar wrote: > > > > On Sat, Sep 2, 2023 at 10:09 AM Amit Kapila wrote: > > > > > The other possibilities apart from not allowing an upgrade in such a > > >

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 11:18 AM Amit Kapila wrote: > > On Mon, Sep 4, 2023 at 10:33 AM Dilip Kumar wrote: > > > > On Mon, Sep 4, 2023 at 8:41 AM Amit Kapila wrote: > > > > > > On Sat, Sep 2, 2023 at 6:12 PM Dilip Kumar wrote: > > > > >

Re: Optimize planner memory consumption for huge arrays

2023-09-04 Thread Dilip Kumar
lararraysel(PlannerInfo *root, ObjectIdGetDatum(operator), PointerGetDatum(args), Int32GetDatum(varRelid))); - + list_free(args); + pfree(c); Maybe you can just use list_free_deep, instead of storing the constant in a separate variable. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Mon, Sep 4, 2023 at 1:41 PM Dilip Kumar wrote: > > > > I think we can do better, like we can just read the latest > > > checkpoint's LSN before starting the old cluster. And now while > > > checking the slot can't we check if the the slot is invalida

Re: Optimize planner memory consumption for huge arrays

2023-09-04 Thread Dilip Kumar
args), > > Int32GetDatum(varRelid))); > > - > > + list_free(args); > > + pfree(c); > > > > Maybe you can just use list_free_deep, instead of storing the constant > > in a separate variable. > As I see, the first element in the array is leftop, whic

Re: trying again to get incremental backup

2023-09-04 Thread Dilip Kumar
y accessible, do they have the right contents? Can't we think of comparing at the block level, like we can compare each block but ignore the content of the hole? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Dilip Kumar
n the thread and we have a conclusion on this then maybe we can mention this in comments? /* * Flush all replication slots to disk. * - * This needn't actually be part of a checkpoint, but it's a convenient - * location. + * is_shutdown is true in case of a shutdown checkpoint. */ void -CheckPointReplicationSlots(void) +CheckPointReplicationSlots(bool is_shutdown) It seems we have removed two lines from the function header comments, is this intentional or accidental? Other than this patch LGTM. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Impact of checkpointer during pg_upgrade

2023-09-04 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 9:38 AM Amit Kapila wrote: > > On Mon, Sep 4, 2023 at 4:19 PM Dilip Kumar wrote: > > > > Said that there is a possibility that some of the slots which got > > invalidated even on the previous checkpoint might get the same LSN as > > the slot

Re: persist logical slots to disk during shutdown checkpoint

2023-09-04 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 9:58 AM Amit Kapila wrote: > > On Tue, Sep 5, 2023 at 9:10 AM Dilip Kumar wrote: > > > > The comments don't mention anything about why we are just flushing at > > the shutdown checkpoint. I mean the checkpoint is not that frequent > >

Re: Impact of checkpointer during pg_upgrade

2023-09-05 Thread Dilip Kumar
ng normal operation? Okay, I am also not sure of that. If users really want to leave > behind such invalidated slots after upgrade, we can even think of > providing some option like "exclude_invalid_logical_slots". +1 -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
k and call > > > ReplicationSlotMarkDirty which will take lock again. > > > > Yes, this is unavoidable, but maybe it's not a big problem as > > we only do it at shutdown. > > > > True but still it doesn't look elegant. I also thought about

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
lock would > make > it more robust. I think our all logic is based on that the walsender is existed already. If not then even if you check under the mutex that the confirmed flush LSN is not changed then it can changed right after you release the lock and then we will not be flushing the lat

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
On Wed, Sep 6, 2023 at 9:47 AM Amit Kapila wrote: > > On Tue, Sep 5, 2023 at 6:00 PM Dilip Kumar wrote: > > Right, it can change and in that case, the check related to > confirm_flush LSN will fail during the upgrade. However, the point is > that if we don't take spinlo

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
On Wed, Sep 6, 2023 at 12:01 PM Amit Kapila wrote: > > On Wed, Sep 6, 2023 at 9:57 AM Dilip Kumar wrote: > > > > On Wed, Sep 6, 2023 at 9:47 AM Amit Kapila wrote: > > > > > > On Tue, Sep 5, 2023 at 6:00 PM Dilip Kumar wrote: > > > > > >

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Dilip Kumar
o be more > > defensive. But couldn't we do that just like we do for autovacuum and > > force the GUCs that could remove the slot's WAL to not do their work > > instead? > > > > I think if we just make max_slot_wal_keep_size to -1 that should be > sufficient to not let any slots get invalidated during upgrade. Do you > have anything else in mind? This seems like a good solution to the problem. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: CHECK Constraint Deferrable

2023-09-08 Thread Dilip Kumar
here, especially the words RECHECK, DISABLE, and ENABLE. And also the name of the enum is a bit off. We can name it more like a unique constraint YES, PARTIAL, EXISTING -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: Impact of checkpointer during pg_upgrade

2023-09-10 Thread Dilip Kumar
isBinaryUpgrade is tempting in the invalidation slot path. > > > > I agree with doing something simple. So, to conclude, we agree on two > things in this thread (a) Use max_slot_wal_keep_size to -1 to start > postmaster for the old cluster during the upgrade; (b) Have an > elog(ERROR) to avoid invalidating slots during the upgrade. +1 -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-10 Thread Dilip Kumar
he slot still usable?" I think it should be "Is the slot usable?" otherwise it appears that we have first fetched the slots and now we are refetching it and checking whether it is still usable. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-10 Thread Dilip Kumar
On Mon, Sep 11, 2023 at 11:16 AM Amit Kapila wrote: > > On Mon, Sep 11, 2023 at 10:39 AM Dilip Kumar wrote: > > > > 3. > > - with the primary.) Replication slots are not copied and must > > - be recreated. > > + with the primary.) Replicat

Re: trying again to get incremental backup

2023-09-12 Thread Dilip Kumar
remental_blocks) + break; 6. +typedef struct +{ + TimeLineID tli; + XLogRecPtr start_lsn; + XLogRecPtr end_lsn; +} backup_wal_range; + +typedef struct +{ + uint32 status; + const char *path; + size_t size; +} backup_file_entry; Better we add some comments for these structures. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-13 Thread Dilip Kumar
and again shut it down? I don't think that is really an acceptable idea. Maybe as discussed in the past we can provide an option to skip the slot checking and during the --check command we can give a WARNING and suggest that better to use --skip-slot-checking for the main upgrade as we have already checked. This could still be okay for the user. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-13 Thread Dilip Kumar
g_upgrade, might need some agreement. Yeah right, in fact during the --check command we can give that suggestion as well. I feel option 2 looks best to me unless there is some design issue to that, as of now I do not see any issue with that though. Let's see what others think. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-13 Thread Dilip Kumar
On Thu, Sep 14, 2023 at 10:00 AM Amit Kapila wrote: > > On Thu, Sep 14, 2023 at 9:21 AM Dilip Kumar wrote: > > > Cons: Although we have some examples for using functions > > > (binary_upgrade_set_next_pg_enum_oid ...) to set some variables during > > > upgra

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-19 Thread Dilip Kumar
2_VACUUM or other vacuum-related commands can not occur during the upgrade? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-20 Thread Dilip Kumar
On Wed, Sep 20, 2023 at 12:12 PM Amit Kapila wrote: > > On Wed, Sep 20, 2023 at 11:51 AM Dilip Kumar wrote: > > > > On Wed, Sep 20, 2023 at 11:00 AM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > Dear Amit, > > > > > > Thank you fo

Re: logical decoding and replication of sequences, take 2

2023-09-20 Thread Dilip Kumar
origptr); } } -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: New WAL record to detect the checkpoint redo location

2023-09-21 Thread Dilip Kumar
if (XLOG_CHECKPOINT_REDO) should be else if (info == XLOG_CHECKPOINT_REDO) That's all I have for now. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-09-22 Thread Dilip Kumar
On Wed, Sep 20, 2023 at 3:23 PM Dilip Kumar wrote: > > On Wed, Aug 16, 2023 at 7:57 PM Tomas Vondra > wrote: > > > > I was reading through 0001, I noticed this comment in > ReorderBufferSequenceIsTransactional() function > > + * To decide if a sequence change shou

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-25 Thread Dilip Kumar
since the last checkpoint and that is not yet synched to the disk then we are doing so. I think this is the most important change otherwise many slots for which we have already streamed all the WAL might give an error assuming that there are pending WAL from the slots which are not yet confirmed. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-25 Thread Dilip Kumar
On Mon, Sep 25, 2023 at 12:30 PM Dilip Kumar wrote: > > On Mon, Sep 25, 2023 at 11:15 AM Bharath Rupireddy > wrote: > > > > On Fri, Sep 22, 2023 at 12:11 PM Amit Kapila > > wrote: > > > > > > Yeah, both by tests and manually verifying the WAL re

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-25 Thread Dilip Kumar
On Mon, Sep 25, 2023 at 1:23 PM Bharath Rupireddy wrote: > > On Mon, Sep 25, 2023 at 12:32 PM Dilip Kumar wrote: > > > > > > Is there anything else that stops this patch from supporting migration > > > > of logical replication slots from PG versions < 17?

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-10-02 Thread Dilip Kumar
that after commit_flush_lsn no decodable record was generated then we are safe to upgrade that slot. So this seems an expandable approach. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com

<    3   4   5   6   7   8   9   10   11   12   >