服务器挂起时丢失记录 [英] Losing records when server hang

查看:65
本文介绍了服务器挂起时丢失记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在观察以下内容:

如果我提交以下记录1,2,3,4,5,6 ,7,8,9,10到数据库

和服务器挂起,我可能会丢失记录5,6,7,8,9但记录10是

那里。这怎么可能,有谁知道Postgresql

如何实际写入记录?


谢谢,

托马斯。


---------------------------(广播结束)--------- ------------------

提示3:如果通过Usenet发布/阅读,请发送适当的

订阅 - nomail命令 ma*******@postgresql.org 以便你的

消息可以干净利落地到达邮件列表

Hi,

I''m observing the following:
If I commit the following records 1,2,3,4,5,6,7,8,9,10 to the database
and the server hangs, I could lose records 5,6,7,8,9 but record 10 is
there. How is this possible and do anyone know how Postgresql
physically writes the records?

Thanks,
thomas.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

推荐答案

On Sun,2004-08-08 at 19:43,lec写道:
On Sun, 2004-08-08 at 19:43, lec wrote:


我正在观察以下内容:
如果我提交以下记录1,2,3,4,5,6,7 ,8,9,10到数据库
和服务器挂起,我可能会丢失记录5,6,7,8,9,但记录10是
。这怎么可能,有人知道Postgresql如何实际写入记录吗?
Hi,

I''m observing the following:
If I commit the following records 1,2,3,4,5,6,7,8,9,10 to the database
and the server hangs, I could lose records 5,6,7,8,9 but record 10 is
there. How is this possible and do anyone know how Postgresql
physically writes the records?




假设一个功能正常的存储子系统和一个内核做了

不是关于fsync,这是不可能的。


您是否在启用了写缓存的IDE驱动器上运行?

大多数,如果不是全部,IDE驱动器就是关于FSYNC的,如果电源

被断开连接,可能会丢失数据。


或者如果你在postgresql中使用fsync = false运行.conf同样的事情

可能发生。否则,不应该发生。或许更多信息?

---------------------------(播出结束)------ ---------------------

提示6:您是否搜索了我们的列表档案?

http://archives.postgresql.org



Assuming a properly function storage subsystem and a kernel that does
not lie about fsync, this is not possible.

Are you running on top of IDE drives with the write cache enabled?
Most, if not all, IDE drives lie about FSYNC and can lose data if power
is disconnected abrubtly.

Or if you are running with fsync=false in postgresql.conf the same thing
can happen. Otherwise, not, it should not happen. More info perhaps?
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


On Sun,2004年8月8日下午08:36:36 -0600,Scott Marlowe写道:
On Sun, Aug 08, 2004 at 08:36:36PM -0600, Scott Marlowe wrote:
On Sun,2004-08-08 at 19:43,lec写道:
On Sun, 2004-08-08 at 19:43, lec wrote:


如果我将以下记录1,2,3,4,5,6,7,8,9,10提交给数据库
和服务器挂起,我可能会丢失记录5,6,7,8,9,但记录10是
。这怎么可能,有谁知道Postgresql如何实际写入记录?
If I commit the following records 1,2,3,4,5,6,7,8,9,10 to the database
and the server hangs, I could lose records 5,6,7,8,9 but record 10 is
there. How is this possible and do anyone know how Postgresql
physically writes the records?



假设一个功能正常的存储子系统和内核确实没有关于fsync的谎言,这是不可能的。



Assuming a properly function storage subsystem and a kernel that does
not lie about fsync, this is not possible.




实际上,如果他使用几个后端来完成这项工作,那么

交易记录10次提交在挂起之前,5,6,7,8,9

不要。


如果这只是一个后端,那么我''我喜欢看他是怎么做到的。


-

Alvaro Herrera(< alvherre [@] dcc.uchile.cl>)

垄断一颗行星的能力是微不足道的

旁边的力量来源


------ ---------------------(广播结束)------------------------ ---

提示8:解释分析是你的朋友



It is actually possible if he uses several backends to do the job, and
transaction inserting record 10 commits before the hang, and 5,6,7,8,9
don''t.

If this is only one backend, then I''d love to see how did he do that.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"The ability to monopolize a planet is insignificant
next to the power of the source"

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


On Sun,2004-08-08 at 21:26 ,Alvaro Herrera Munoz写道:
On Sun, 2004-08-08 at 21:26, Alvaro Herrera Munoz wrote:
On Sun,2004年8月8日下午08:36:36 -0600,Scott Marlowe写道:
On Sun, Aug 08, 2004 at 08:36:36PM -0600, Scott Marlowe wrote:
On Sun,2004-08-08 at 19:43,lec写道:
On Sun, 2004-08-08 at 19:43, lec wrote:
如果我将以下记录1,2,3,4,5,6,7,8,9,10提交到数据库
并且服务器挂起,我可能会丢失5,6,7,8,9的记录,但记录10是在那里。这怎么可能,有谁知道Postgresql如何实际写入记录?
If I commit the following records 1,2,3,4,5,6,7,8,9,10 to the database
and the server hangs, I could lose records 5,6,7,8,9 but record 10 is
there. How is this possible and do anyone know how Postgresql
physically writes the records?



假设一个功能正常的存储子系统和内核确实没有关于fsync的谎言,这是不可能的。



Assuming a properly function storage subsystem and a kernel that does
not lie about fsync, this is not possible.



实际上,如果他使用几个后端来完成这项工作,并且
事务插入记录10在挂起之前提交,并且5,6 ,7,8,9
不是。



It is actually possible if he uses several backends to do the job, and
transaction inserting record 10 commits before the hang, and 5,6,7,8,9
don''t.




是的,但他明确表示他会做1到10次。除非他/>
并不理解commit的含义。即提交AND

收到该提交的确认。直到数据库说它已经提交了b / b $ b,没有提交任何内容,所以他可能只是认为

触发了插入查询提交。我没想到那个

角。


是这样吗,lec?

如果这只是一个后端,然后我很想知道他是怎么做到的。



Yeah, but he explicitly said he''d committed 1 through 10. Unless he
didn''t understand what is meant by commit. I.e. committing AND
receiving the ack for that commit. Until the database says it
committed, nothing''s been committed, so he might have thought just
firing the insert query was committing. I hadn''t really thought of that
angle.

Is that the case, lec?
If this is only one backend, then I''d love to see how did he do that.




我也是:-)

---- -----------------------(播出结束)---------------------- -----

提示8:解释分析是你的朋友



Me too :-)
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


这篇关于服务器挂起时丢失记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆