From: Koichi S. <koi...@gm...> - 2013-05-09 12:44:20
|
Thanks Nikhil; I reviewed and tested the patch. It looks nice. Old code used the return value both as the status and sequence value, which brought considerable confusion in the code. The patch solves this problem by distinguishing return status and the value. If there's no further imput, I'd like to commit it. Then I will review Andrei's patch to improve gtm. Regards; ---------- Koichi Suzuki 2013/4/30 Nikhil Sontakke <ni...@st...> > PFA, patch which allows sequences with negative values. > > I have also added test cases in xc_sequence.sql. > > Regards, > Nikhils > > > > On Mon, Apr 22, 2013 at 1:49 PM, Nikhil Sontakke <ni...@st...>wrote: > >> The currval() logic also has a similar issue. >> >> Regards, >> Nikhils >> >> >> On Mon, Apr 22, 2013 at 6:18 AM, 鈴木 幸市 <ko...@in...> wrote: >> >>> I'm afraid the cause is not only by gym. If min_value is not specified >>> (or specified as "invalid" value), gtm assigns -0x7ffffffffffffffeLL as the >>> minimum value of the sequence (see gtm_seq.[ch]). So I suspect that >>> minimum value will be specified by DDL in the coordinator. >>> >>> You fix is very welcome. >>> >>> GTM in the current master has a backup feature which dumps next restore >>> point of gxid and each sequence to gtm.control. I hope this helps tests >>> to some extent. >>> >>> Regards; >>> --- >>> Koichi Suzuki >>> >>> >>> >>> On 2013/04/22, at 8:32, Michael Paquier <mic...@gm...> >>> wrote: >>> >>> >>> >>> >>> On Mon, Apr 22, 2013 at 3:57 AM, Nikhil Sontakke <ni...@st...>wrote: >>> >>>> Hi all, >>>> >>>> Consider the following: >>>> >>>> create sequence seqname increment by -2; >>>> select nextval('seqname'); >>>> ERROR: GTM error, could not obtain sequence value >>>> >>>> The above should have returned -1. >>>> >>>> ISTM, the sequence fetching logic on the backend side has been coded >>>> entirely with the assumption that sequences can never have negative values. >>>> So a less than 0 value returned from get_next() is assumed to be a problem! >>>> That's completely wrong. We need to deal with this properly. I will submit >>>> a patch for this when I get some time soon. >>>> >>> Adding a regression test in xc_sequence.sql would also be good to cover >>> this case as this is caused by xc-only code. >>> -- >>> Michael >>> ------------------------------------------------------------------------------ >>> 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 >>> >>> >>> >> >> >> -- >> StormDB - http://www.stormdb.com >> The Database Cloud >> > > > > -- > StormDB - http://www.stormdb.com > The Database Cloud > > > ------------------------------------------------------------------------------ > Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET > Get 100% visibility into your production application - at no cost. > Code-level diagnostics for performance bottlenecks with <2% overhead > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap1 > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > > |