Обсуждение: DB transactions when browser freezes

Поиск
Список
Период
Сортировка

DB transactions when browser freezes

От
dafNi zaf
Дата:
Hello to everybody,

I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
order to fill up a database.
The uploding completed and the transactions started. But unfortunately, my
browser crashed/freezed in the middle of the transactions.

I wanted to know, given that the uploading of the file was completed, will the
transactions keep executing on server??

Before the browser crashed there was a process that consumed 23.6% of the
CPU for the transactions and now, I see the same process with approximately
the same percentage.

Should I assume that the transactions keep running?

I am trying to avoid uploading the file all over again because it has already been
running for 5 hours.


Thank you in advance!!
dafNi

Re: DB transactions when browser freezes

От
Adrian Klaver
Дата:
On 08/08/2013 07:33 AM, dafNi zaf wrote:
> Hello to everybody,
>
> I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
> order to fill up a database.
> The uploding completed and the transactions started. But unfortunately, my
> browser crashed/freezed in the middle of the transactions.
>
> I wanted to know, given that the uploading of the file was completed,
> will the
> transactions keep executing on server??
>
> Before the browser crashed there was a process that consumed 23.6% of the
> CPU for the transactions and now, I see the same process with approximately
> the same percentage.
>
> Should I assume that the transactions keep running?
>
> I am trying to avoid uploading the file all over again because it has
> already been
> running for 5 hours.

tail the server log and verify.

>
>
> Thank you in advance!!
> dafNi


--
Adrian Klaver
adrian.klaver@gmail.com


Re: DB transactions when browser freezes

От
Alban Hertroys
Дата:
On 8 August 2013 16:33, dafNi zaf <dzaf88@gmail.com> wrote:

Hello to everybody,

I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
order to fill up a database.
The uploding completed and the transactions started. But unfortunately, my
browser crashed/freezed in the middle of the transactions.

I wanted to know, given that the uploading of the file was completed, will the
transactions keep executing on server??

Before the browser crashed there was a process that consumed 23.6% of the
CPU for the transactions and now, I see the same process with approximately
the same percentage.

Should I assume that the transactions keep running?

I am trying to avoid uploading the file all over again because it has already been
running for 5 hours.

There is a chance that the database server is just still processing your request and that it will only figure out that there's a client error once it reaches the end of that 20GB file, after which the client returns an error and the database rolls back the transaction.

Depending on how phpPgAdmin/PHP were implemented, that's not necessarily what'll happen though, so you might just get lucky and the transaction commits.

Hard to tell, I know nothing about the internals of phpPgAdmin.

What kind of file is it anyway? A database dump perhaps?

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

Re: DB transactions when browser freezes

От
David Johnston
Дата:
dafNi wrote
> Should I assume that the transactions keep running?

Never assume...or at least try and verify those assumptions when possible.

To verify this assumption:

Connect to the DB directly as a super-user and run this (or something
similar):

SELECT procpid, current_query, client_addr, xact_start, query_start
    FROM pg_stat_activity
    ORDER BY xact_start ASC, client_addr;

to what activity is currently in-progress.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/DB-transactions-when-browser-freezes-tp5766824p5766829.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: DB transactions when browser freezes

От
Ian Lawrence Barwick
Дата:
2013/8/8 dafNi zaf <dzaf88@gmail.com>:
> Hello to everybody,
>
> I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
> order to fill up a database.

20GB is a lot to be uploading from a browser, even in this day and age.

Is the web server configured to accept uploads of that size?


Re: DB transactions when browser freezes

От
dafNi zaf
Дата:
i execute it periodically and sometimes there is a transaction and other times it's idle:

INSERT INTO traces VALUES (.....)
 or
<IDLE> in transaction

 So it's still running.. even thought there is some idle time.


Thank you very much!


On Thu, Aug 8, 2013 at 5:46 PM, David Johnston <polobo@yahoo.com> wrote:
dafNi wrote
> Should I assume that the transactions keep running?

Never assume...or at least try and verify those assumptions when possible.

To verify this assumption:

Connect to the DB directly as a super-user and run this (or something
similar):

SELECT procpid, current_query, client_addr, xact_start, query_start
        FROM pg_stat_activity
        ORDER BY xact_start ASC, client_addr;

to what activity is currently in-progress.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/DB-transactions-when-browser-freezes-tp5766824p5766829.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: DB transactions when browser freezes

От
dafNi zaf
Дата:
its a huge file with such queries:

BEGIN;
INSERT INTO traces VALUES (.....);
.
.
.
COMMIT;


Anyway, I managed to see that the transactions still occure like David Johnston sugested. And luckily the browser is alive now after one hour that it had been freezed...


thank you very much for the reply!



On Thu, Aug 8, 2013 at 5:46 PM, Alban Hertroys <haramrae@gmail.com> wrote:
On 8 August 2013 16:33, dafNi zaf <dzaf88@gmail.com> wrote:

Hello to everybody,

I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
order to fill up a database.
The uploding completed and the transactions started. But unfortunately, my
browser crashed/freezed in the middle of the transactions.

I wanted to know, given that the uploading of the file was completed, will the
transactions keep executing on server??

Before the browser crashed there was a process that consumed 23.6% of the
CPU for the transactions and now, I see the same process with approximately
the same percentage.

Should I assume that the transactions keep running?

I am trying to avoid uploading the file all over again because it has already been
running for 5 hours.

There is a chance that the database server is just still processing your request and that it will only figure out that there's a client error once it reaches the end of that 20GB file, after which the client returns an error and the database rolls back the transaction.

Depending on how phpPgAdmin/PHP were implemented, that's not necessarily what'll happen though, so you might just get lucky and the transaction commits.

Hard to tell, I know nothing about the internals of phpPgAdmin.

What kind of file is it anyway? A database dump perhaps?

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

Re: DB transactions when browser freezes

От
dafNi zaf
Дата:
yes, I altered the php.ini file in /etc/php5/apache2/ directory in order to accept huge files.

The uploading has been completed and the transactions started.


I can now see the transactions using either: ps aux | grep postgres (via command line)
or the solution David Johnston sugested.

Thank you for the reply!
dafNi


On Thu, Aug 8, 2013 at 5:57 PM, Ian Lawrence Barwick <barwick@gmail.com> wrote:
2013/8/8 dafNi zaf <dzaf88@gmail.com>:
> Hello to everybody,
>
> I started to upload (via phpPgAdmin) to a local server a huge file (20GB) in
> order to fill up a database.

20GB is a lot to be uploading from a browser, even in this day and age.

Is the web server configured to accept uploads of that size?
Y