Re: Sometime Update is not modifying data inside database.

From: Craig James <cjames(at)emolecules(dot)com>
To: Amit Kumar <helloamit5(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, amit(dot)jain(at)netcore(dot)co(dot)in
Subject: Re: Sometime Update is not modifying data inside database.
Date: 2012-07-30 16:52:39
Message-ID: CAFwQ8rfgEvG9BTLU6UZxVv7twCuudMt50a1Msu6oFFmb=hv_UQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Jul 30, 2012 at 4:06 AM, Amit Kumar <helloamit5(at)gmail(dot)com> wrote:

> All,
>
> I am facing a weired issue in PG 9.0.3. Sometime via application UPDATES
> are not changing data in the database but in postgres logs its also not
> raising any error. It is happening 2-3 times in a week. I have tried but
> not able to reproduce this error. fsync is ON. We are not using hibernate
> and no pg pool or any other tool inside database. The application
> running from last 4-5 year but from last few days we are experiencing some
> times UPDATE is not updating records in database, without giving any
> error. No changes has been made in database or server recently.
>
> *UPDATE dbpush_camp_main SET status=7 WHERE camp_id IN(137721)*
>
> Below is the logs of database.
>
> <snip>
> Jul 30 12:40:36 dell16 postgres[11088]: [11-1] 2012-07-30 12:40:36 IST
> [11088]: [10-1] user=postgres,db=dbpush xxxxxxxxxxxxxxxxxx(43225)LOG:
> statement: START TRANSACTION
> Jul 30 12:40:36 dell16 postgres[11088]: [12-1] 2012-07-30 12:40:36 IST
> [11088]: [11-1] user=postgres,db=dbpush xxxxxxxxxxxxxxxxxx(43225)LOG:
> statement: *UPDATE dbpush_camp_main SET status=7 WHERE camp_id IN(137721)*
> Jul 30 12:40:36 dell16 postgres[11088]: [13-1] 2012-07-30 12:40:36 IST
> [11088]: [12-1] user=postgres,db=dbpush xxxxxxxxxxxxxxxxxx(43225)LOG:
> statement: COMMIT
> Jul 30 12:40:36 dell16 postgres[9368]: [5-1] 2012-07-30 12:40:36 IST
> [9368]: [4-1] user=postgres,db=dbpush xxxxxxxxxxxxxxxxxx(43187)LOG:
> statement: SELECT status FROM dbpush_camp_main WHERE camp_id=137721
> </snip>
>
> The size of database is 237GB, AND dbpush_camp_main table size is 37MB
> with 36888 records and one primary key. status is a integer field.
>
> Please share your thoughts. Thanks a lot in Advance !!
>

You've almost certainly got problems with overlapping transactions, where
the process making the change and the process testing the change are
looking at different "snapshots" of the data. The "snapshot" started when
each one started its own transaction.

Craig

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Klink, John 2012-07-31 23:00:42 Grant Privliages Based on Unix Groups
Previous Message Tom Lane 2012-07-30 13:53:05 Re: Sometime Update is not modifying data inside database.