Обсуждение: Hot Backup

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

Hot Backup

От
"Sandeep Chadha"
Дата:
Hello to all the Doers of Postgres!!!

Last time I went through forums, people spoke highly about 7.3 and its capability to do hot backups. My problem is if
thedatabase goes down and I lose my main data store, then I will lose all transactions back to the time I did the
pg_dump.

Other databases (i e Oracle) solves this by retaining their archive logs in some physically separate storage. So, when
youlose your data, you can restore the data from back-up, and then apply your archive log, and avoid losing any
committedtransactions.  

Postgresql has been lacking this all along. I've installed postgres 7.3b2 and still don't see any archive's flushed to
anyother place. Please let me know how is hot backup procedure implemented in current 7.3 beta(2) release. 


Thanks.

Point in Time Recovery WAS: Hot Backup

От
"scott.marlowe"
Дата:
Hi Sandeep.  What you were calling Hot Backup is really called Point in
Time Recovery (PITR).  Hot Backup means making a complete backup of the
database while it is running, something Postgresql has supported for a
very long time.

On Mon, 7 Oct 2002, Sandeep Chadha wrote:

> Hello to all the Doers of Postgres!!!
>
> Last time I went through forums, people spoke highly about 7.3 and its
> capability to do hot backups. My problem is if the database goes down
> and I lose my main data store, then I will lose all transactions back
> to the time I did the pg_dump.

Let's make it clear that this kind of failure is EXTREMELY rare on real
database servers since they almost ALL run their data sets on RAID arrays.
While it is possible to lost >1 drive at the same time and all your
database, it is probably more likely to have a bad memory chip corrupt
your data silently, or a bad query delete data it shouldn't.

That said, there IS work ongoing to provide this facility for Postgresql,
but I would much rather have work done on making large complex queries run
faster, or fix the little issues with foreign keys cause deadlocks.

> Other databases (i e Oracle) solves this by retaining their archive
> logs in some physically separate storage. So, when you lose your data,
> you can restore the data from back-up, and then apply your archive log,
> and avoid losing any committed transactions.
>
> > Postgresql has been lacking this all along. I've installed postgres
> 7.3b2 and still don't see any archive's flushed to any other place.
> Please let me know how is hot backup procedure implemented in current
> 7.3 beta(2) release.

Again, you'll get better response to your questions if you call it "point
in time recovery" or pitr.  Hot backup is the wrong word, and something
Postgresql DOES have.

It also supports WALs, which stands for Write ahead logs.  These files
store what the database is about to do before it does it.  Should the
database crash with transactions pending, the server will come back up and
process the pending transactions that are in the WAL files, ensuring the
integrity of your database.

Point in Time recovery is very nice, but it's the last step in many to
ensure a stable, coherent database, and will probably be in 7.4 or
somewhere around there.  If you're running in a RAID array, then the loss
of your datastore should be a very remote possibility.


Question about DEADLOCK

От
Savita
Дата:
Hi All,

I have a question related to postgres.I have an application which is transferring data from MSSQL to Postgres at some regular interval.

I had around 20,000 data in MSSQL which should be transferred to postgres.
After transferring around 12000 data I got a error message
ERROR: deadlock detected
And after that data transfer has stopped.

How to avoid this error and what is the reason for this error.
--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------
 

Re: Question about DEADLOCK

От
Stephan Szabo
Дата:
On Fri, 22 Nov 2002, Savita wrote:

> Hi All,
>
> I have a question related to postgres.I have an application which is
> transferring data from MSSQL to Postgres at some regular interval.
>
> I had around 20,000 data in MSSQL which should be transferred to postgres.
> After transferring around 12000 data I got a error message
> ERROR: deadlock detected
> And after that data transfer has stopped.
>
> How to avoid this error and what is the reason for this error.

Most likely cause would be a concurrent transaction doing something that
caused a foreign key to get into a dead lock situation (the current
implementation grabs overly strong locks).  In any case, we'll need more
information about what else was going on probably.



Re: Question about DEADLOCK

От
Savita
Дата:
Thanks Stephan,

I wold like to know where to get LOCK manual/reference.

And what is ther error number it will return when this error will come.Is there
any work around this.HOw do I avoid this situation.

--
Best Regards
- Savita
----------------------------------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
----------------------------------------------------


Stephan Szabo wrote:

> On Fri, 22 Nov 2002, Savita wrote:
>
> > Hi All,
> >
> > I have a question related to postgres.I have an application which is
> > transferring data from MSSQL to Postgres at some regular interval.
> >
> > I had around 20,000 data in MSSQL which should be transferred to postgres.
> > After transferring around 12000 data I got a error message
> > ERROR: deadlock detected
> > And after that data transfer has stopped.
> >
> > How to avoid this error and what is the reason for this error.
>
> Most likely cause would be a concurrent transaction doing something that
> caused a foreign key to get into a dead lock situation (the current
> implementation grabs overly strong locks).  In any case, we'll need more
> information about what else was going on probably.





Re: Question about DEADLOCK

От
Stephan Szabo
Дата:
On Fri, 22 Nov 2002, Savita wrote:

> I wold like to know where to get LOCK manual/reference.

Well, there's the entry for the LOCK command, but I don't think
that's what you want, what exactly are you looking for?


> And what is ther error number it will return when this error will come.Is there
> any work around this.HOw do I avoid this situation.

I don't know of an error number, but the string will will have that
deadlock detected in it. :) As for a workaround, since we don't know
what's causing it, we can't really give you a workaround.

What's the schema of the table you're transferring to and what else
was going on in the server at the time you got the deadlock?  I'd
guess it was a foreign key, but that only applies if you've got
foreign keys, for example.


Re: Question about DEADLOCK

От
snpe
Дата:
Hello,
You try load data first and then referential constraints

regards
Haris Peco
On Friday 22 November 2002 07:10 am, Savita wrote:
> Thanks Stephan,
>
> I wold like to know where to get LOCK manual/reference.
>
> And what is ther error number it will return when this error will come.Is
> there any work around this.HOw do I avoid this situation.
>
> --
> Best Regards
> - Savita
> ----------------------------------------------------
> Hewlett Packard (India)
> +91 80 2051288 (Phone)
> 847 1288 (HP Telnet)
> ----------------------------------------------------
>
> Stephan Szabo wrote:
> > On Fri, 22 Nov 2002, Savita wrote:
> > > Hi All,
> > >
> > > I have a question related to postgres.I have an application which is
> > > transferring data from MSSQL to Postgres at some regular interval.
> > >
> > > I had around 20,000 data in MSSQL which should be transferred to
> > > postgres. After transferring around 12000 data I got a error message
> > > ERROR: deadlock detected
> > > And after that data transfer has stopped.
> > >
> > > How to avoid this error and what is the reason for this error.
> >
> > Most likely cause would be a concurrent transaction doing something that
> > caused a foreign key to get into a dead lock situation (the current
> > implementation grabs overly strong locks).  In any case, we'll need more
> > information about what else was going on probably.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


Re: Question about DEADLOCK

От
Hans-Jürgen Schönig
Дата:
I recommend reading Tom Lane's talk "Concurrency Issues" at OSCON2002.
This will answer all questions and some more.

    Best regards,

            Hans



Savita wrote:

>--------------880B7BB5722DEBFDA92AF2C3
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>Hi All,
>
>I have a question related to postgres.I have an application which is transferring data from MSSQL to Postgres at some
regularinterval. 
>
>I had around 20,000 data in MSSQL which should be transferred to postgres.
>After transferring around 12000 data I got a error message
>ERROR: deadlock detected
>And after that data transfer has stopped.
>
>How to avoid this error and what is the reason for this error.
>--
>Best Regards
>- Savita
>----------------------------------------------------
>Hewlett Packard (India)
>+91 80 2051288 (Phone)
>847 1288 (HP Telnet)
>----------------------------------------------------
>
>
>--------------880B7BB5722DEBFDA92AF2C3
>Content-Type: text/html; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>
>Hi All,
><p>I have a question related to postgres.I have an application which is
>transferring data from MSSQL to Postgres at some regular interval.
><p>I had around 20,000 data in MSSQL which should be transferred to postgres.
><br>After transferring around 12000 data I got a error message
><br><b><font color="#3333FF">ERROR: deadlock detected</font></b>
><br><font color="#000000">And after that data transfer has stopped.</font><font color="#000000"></font>
><p><font color="#000000">How to avoid this error and what is the reason
>for this error.</font>
><br>--
><br>Best Regards
><br>- Savita
><br>----------------------------------------------------
><br>Hewlett Packard (India)
><br>+91 80 2051288 (Phone)
><br>847 1288 (HP Telnet)
><br>----------------------------------------------------
><br> </html>
>
>--------------880B7BB5722DEBFDA92AF2C3--
>
>
>


--
*Cybertec Geschwinde u Schoenig*
Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria
Tel: +43/1/913 68 09; +43/664/233 90 75
www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at
<http://cluster.postgresql.at>, www.cybertec.at
<http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>


Re: Question about DEADLOCK

От
Thomas O'Connell
Дата:
I haven't seen this before, and I can't find it on techdocs. Can you
post a link to it?

-tfo

In article <3DDDE7D0.5040803@cybertec.at>,
 Hans-Jurgen Schonig <hs@cybertec.at> wrote:

> I recommend reading Tom Lane's talk "Concurrency Issues" at OSCON2002.
> This will answer all questions and some more.
>
>     Best regards,
>
>             Hans

Re: Question about DEADLOCK

От
Tom Lane
Дата:
"Thomas O'Connell" <tfo@monsterlabs.com> writes:
>  Hans-Jurgen Schonig <hs@cybertec.at> wrote:
>> I recommend reading Tom Lane's talk "Concurrency Issues" at OSCON2002.

> I haven't seen this before, and I can't find it on techdocs. Can you
> post a link to it?

You can find a PDF at O'Reilly's conferences archive,

http://conferences.oreillynet.com/cs/os2002/view/e_sess/2681

I recall asking Vince to put a copy on the Postgres website, but I don't
think he ever got around to it.

            regards, tom lane