pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSometime Update is not modifying data inside database.
3+ messages / 3 participants
[nested] [flat]
* Sometime Update is not modifying data inside database.
@ 2012-07-30 11:06 Amit Kumar <helloamit5@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Amit Kumar @ 2012-07-30 11:06 UTC (permalink / raw)
To: pgsql-admin; +Cc: amit.jain@netcore.co.in
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 !!
--
--With Best Regards
Amit Jain
#9833777592
"The best reason for having dreams is that in dreams no reasons are
necessary"
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Sometime Update is not modifying data inside database.
@ 2012-07-30 13:53 Tom Lane <tgl@sss.pgh.pa.us>
parent: Amit Kumar <helloamit5@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2012-07-30 13:53 UTC (permalink / raw)
To: Amit Kumar <helloamit5@gmail.com>; +Cc: pgsql-admin; amit.jain@netcore.co.in
Amit Kumar <helloamit5@gmail.com> writes:
> <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>
I assume what you're complaining about is that PID 9368's select didn't
see the result of pid 11088's update? The above trace doesn't prove
that anything is wrong. That behavior would be expected if 9368 had
taken its "snapshot" before 11088's commit finished, and you can't
really tell if that was the case or not from these log entries. But
given they all happened in less than 1 second, it's certainly possible.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Sometime Update is not modifying data inside database.
@ 2012-07-30 16:52 Craig James <cjames@emolecules.com>
parent: Amit Kumar <helloamit5@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Craig James @ 2012-07-30 16:52 UTC (permalink / raw)
To: Amit Kumar <helloamit5@gmail.com>; +Cc: pgsql-admin; amit.jain@netcore.co.in
On Mon, Jul 30, 2012 at 4:06 AM, Amit Kumar <helloamit5@gmail.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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2012-07-30 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 11:06 Sometime Update is not modifying data inside database. Amit Kumar <helloamit5@gmail.com>
2012-07-30 13:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-07-30 16:52 ` Craig James <cjames@emolecules.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox