RC2 intermittent errors

Started by Gaetano Mendolaover 21 years ago5 messageshackers
Jump to latest
#1Gaetano Mendola
mendola@bigfoot.com

Hi all,
I'm testing now RC2 against our application and I'm experiencing
intermittent errors. I isolated this test:

CREATE TABLE users (
id_login SERIAL PRIMARY KEY,
login TEXT
);

CREATE OR REPLACE FUNCTION sp_id_user ( TEXT )
RETURNS INTEGER AS $$
DECLARE
a_login ALIAS FOR $1;
my_id INTEGER;
BEGIN
SELECT id_login INTO my_id
FROM users
WHERE login = a_login;

RETURN COALESCE(my_id, -1 );

END;
$$ LANGUAGE 'plpgsql'
STABLE;

CREATE OR REPLACE FUNCTION sp_test ( TEXT )
RETURNS INTEGER AS $$
DECLARE
a_login ALIAS FOR $1;
my_id INTEGER;
BEGIN
my_id = sp_id_user( a_login );
RAISE NOTICE 'ID> %', my_id;

insert into users (login) values ( a_login );

my_id = sp_id_user( a_login );
RAISE NOTICE 'ID> %', my_id;

RETURN 0;
END;
$$ LANGUAGE 'plpgsql';

select sp_test('test1');
select sp_test('test2');

The call of the two above functions shall show:

ID> -1
ID> 1

ID> -1
ID> 2

instead I have:

test=# select sp_test('test1');
NOTICE: ID> -1
NOTICE: ID> 1
sp_test
---------
0
(1 row)

test=# select sp_test('test2');
NOTICE: ID> -1
NOTICE: ID> -1
sp_test
---------
0
(1 row)

some times I get:

test=# select sp_test('test1');
NOTICE: ID> -1
NOTICE: ID> -1
sp_test
---------
0
(1 row)

test=# select sp_test('test2');
NOTICE: ID> -1
NOTICE: ID> -1
sp_test
---------
0
(1 row)

Regards
Gaetano Mendola

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gaetano Mendola (#1)
Re: RC2 intermittent errors

Gaetano Mendola <mendola@bigfoot.com> writes:

I'm testing now RC2 against our application and I'm experiencing
intermittent errors. I isolated this test:

Argh! I put a GetTransactionSnapshot() call into exec_eval_simple_expr,
but I forgot CommandCounterIncrement(). Wish I could say it was a copy-
and-paste mistake, but it was pure stupidity...

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: RC2 intermittent errors

Tom Lane wrote:

Gaetano Mendola <mendola@bigfoot.com> writes:

I'm testing now RC2 against our application and I'm experiencing
intermittent errors. I isolated this test:

Argh! I put a GetTransactionSnapshot() call into exec_eval_simple_expr,
but I forgot CommandCounterIncrement(). Wish I could say it was a copy-
and-paste mistake, but it was pure stupidity...

Can we continue with RC2 or do we need an RC3?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: RC2 intermittent errors

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

Argh! I put a GetTransactionSnapshot() call into exec_eval_simple_expr,
but I forgot CommandCounterIncrement(). Wish I could say it was a copy-
and-paste mistake, but it was pure stupidity...

Can we continue with RC2 or do we need an RC3?

It's a one-liner change (assuming that my theory is right, which I won't
know for a little bit because I had just make distclean'd in order to
verify my tree against the RC2 tarball). I don't think we should push
an RC3 just for this. Wait a few days and see what else turns up ...

regards, tom lane

#5Gaetano Mendola
mendola@bigfoot.com
In reply to: Tom Lane (#4)
Re: RC2 intermittent errors

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

Argh! I put a GetTransactionSnapshot() call into exec_eval_simple_expr,
but I forgot CommandCounterIncrement(). Wish I could say it was a copy-
and-paste mistake, but it was pure stupidity...

Can we continue with RC2 or do we need an RC3?

It's a one-liner change (assuming that my theory is right, which I won't
know for a little bit because I had just make distclean'd in order to
verify my tree against the RC2 tarball). I don't think we should push
an RC3 just for this. Wait a few days and see what else turns up ...

Did you updated the CVS ?

Regards
Gaetano Mendola