From: Ahsan H. <ahs...@en...> - 2013-04-18 11:35:16
|
Hi Amit, Can you take sometime out to look at this please? I know you are super busy with the trigger work. -- Ahsan On Thu, Apr 18, 2013 at 2:13 AM, Abbas Butt <abb...@en...>wrote: > While doing some testing I found that just checking > res == LOCKACQUIRE_OK > is not enough, the function should succeed if the lock is already held > too, hence the condition should be > (res == LOCKACQUIRE_OK || res == LOCKACQUIRE_ALREADY_HELD) > Attached patch corrects this problem. > > > > On Mon, Apr 8, 2013 at 11:23 AM, Abbas Butt <abb...@en...>wrote: > >> Thanks. I will commit it later today. >> >> >> On Mon, Apr 8, 2013 at 9:52 AM, Amit Khandekar < >> ami...@en...> wrote: >> >>> Hi Abbas, >>> >>> The patch looks good to go. >>> >>> -Amit >>> >>> >>> On 6 April 2013 01:02, Abbas Butt <abb...@en...> wrote: >>> >>>> Hi, >>>> >>>> Consider this test case when run on a single coordinator cluster. >>>> >>>> From one session acquire a lock >>>> >>>> edb@edb-virtual-machine:/usr/local/pgsql/bin$ ./psql postgres >>>> psql (PGXC 1.1devel, based on PG 9.2beta2) >>>> Type "help" for help. >>>> >>>> postgres=# select pg_try_advisory_lock(1234,5678); >>>> pg_try_advisory_lock >>>> ---------------------- >>>> t >>>> (1 row) >>>> >>>> >>>> and from another terminal try to acquire the same lock >>>> >>>> edb@edb-virtual-machine:/usr/local/pgsql/bin$ ./psql postgres >>>> psql (PGXC 1.1devel, based on PG 9.2beta2) >>>> Type "help" for help. >>>> >>>> postgres=# select pg_try_advisory_lock(1234,5678); >>>> pg_try_advisory_lock >>>> ---------------------- >>>> t >>>> (1 row) >>>> >>>> Note that the second request succeeds where as the lock is already held >>>> by the first session. >>>> >>>> The problem is that pgxc_advisory_lock neglects the return of >>>> LockAcquire function in case of single coordinator. >>>> The attached patch corrects the problem. >>>> >>>> Comments are welcome. >>>> >>>> >>>> -- >>>> Abbas >>>> Architect >>>> EnterpriseDB Corporation >>>> The Enterprise PostgreSQL Company >>>> >>>> Phone: 92-334-5100153 >>>> >>>> Website: www.enterprisedb.com >>>> EnterpriseDB Blog: http://blogs.enterprisedb.com/ >>>> Follow us on Twitter: http://www.twitter.com/enterprisedb >>>> >>>> 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. >>>> >>>> ------------------------------------------------------------------------------ >>>> Minimize network downtime and maximize team effectiveness. >>>> Reduce network management and security costs.Learn how to hire >>>> the most talented Cisco Certified professionals. Visit the >>>> Employer Resources Portal >>>> http://www.cisco.com/web/learning/employer_resources/index.html >>>> _______________________________________________ >>>> Postgres-xc-developers mailing list >>>> Pos...@li... >>>> https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers >>>> >>>> >>> >> >> >> -- >> -- >> Abbas >> Architect >> EnterpriseDB Corporation >> The Enterprise PostgreSQL Company >> >> Phone: 92-334-5100153 >> >> Website: www.enterprisedb.com >> EnterpriseDB Blog: http://blogs.enterprisedb.com/ >> Follow us on Twitter: http://www.twitter.com/enterprisedb >> >> 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. >> > > > > -- > -- > Abbas > Architect > EnterpriseDB Corporation > The Enterprise PostgreSQL Company > > Phone: 92-334-5100153 > > Website: www.enterprisedb.com > EnterpriseDB Blog: http://blogs.enterprisedb.com/ > Follow us on Twitter: http://www.twitter.com/enterprisedb > > 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. > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > > -- Ahsan Hadi Snr Director Product Development EnterpriseDB Corporation The Enterprise Postgres Company Phone: +92-51-8358874 Mobile: +92-333-5162114 Website: www.enterprisedb.com EnterpriseDB Blog: http://blogs.enterprisedb.com/ Follow us on Twitter: http://www.twitter.com/enterprisedb 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. |