From: Mason S. <mas...@en...> - 2010-11-17 02:04:32
|
When I tried to test this, I noticed some problem. Maybe it exists without the patch though: mds1=# create sequence myseq2; CREATE SEQUENCE mds1=# select nextval('myseq2'); nextval --------- 0 (1 row) mds1=# select nextval('myseq2'); nextval --------- 0 (1 row) Mason On 11/12/10 1:23 PM, Michael Paquier wrote: > Hi Benny, > > I had a look at your patch, > and it is really a nice feature you implemented. > > With this functionnality, it is possible to drop sequences on GTM in a > very smooth way when a database is dropped. > I have a couple of comments about it though. > > 1) in gtm_seq.c, function seq_start_with_nsp > You make a memory compare that will always return a true result > because you compare the same string. > return ((memcmp(nsp->gsk_key, nsp->gsk_key, nsp->gsk_keylen) == 0) > && (seq->gsk_key[nsp->gsk_keylen] == '.')); > I believe this is the right code: > return ((memcmp(nsp->gsk_key, seq->gsk_key, nsp->gsk_keylen) == 0) > && (seq->gsk_key[nsp->gsk_keylen] == '.')); > > 2) in gtm_seq.c, function GTM_RmSeqWithNsp > When you encounter a sequence that is used by another process, you > mark it for deletion and then you exit the process, > letting perhaps a lot of sequences not dropped. > I think priority should be given to deletion, as DROP DATABASE has to > be forced. > Btw, a busy sequence cannot basically be found because that would mean > that an instance is still using the database, > and in this case database drop is not possible. > > 3) in gtm_c.h, about the message type definition. > I made a modification in message type so as not to use a unique character. > Using an enumeration (typedef enum) makes it more consistent with > Postgres-xc code, and it makes code maintenance easier. > > 4) Also I notice a couple of typo problems, take care when you use > spaces and tabs! > > I corrected those points above in the patch attached. > I also changed a couple of function names to make it clearer. > > You should check it and make a couple of additional tests also. > Perhaps you have additional ideas about this implementation, don't > hesitate to share what you think. > > Regards, > > -- > Michael Paquier > http://michaelpq.users.sourceforge.net > > > ------------------------------------------------------------------------------ > Centralized Desktop Delivery: Dell and VMware Reference Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > > > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > -- Mason Sharp EnterpriseDB Corporation The Enterprise Postgres Company This e-mail message (and any attachment) is intended for the use of the individual or entity to whom it is addressed. This message contains information from EnterpriseDB Corporation that may be privileged, confidential, or exempt from disclosure under applicable law. If you are not the intended recipient or authorized to receive this for the intended recipient, any use, dissemination, distribution, retention, archiving, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete this message. |