删除的行再次出现
我有一个在 ubuntu 上运行的 ac 程序,连接到 mysql (5.0.51a-3ubuntu5.4-log)。
该程序的主要任务是处理来自小型(<5000 行)myisam 表的记录。 如果该行处理成功,则将其删除。 如果没有,则稍后重试。 多次尝试失败后,该内容将被删除。 删除使用表主键并且很简单,即它不指定 low_priority、quick 或ignore。 该程序使用单独的连接进行读取和写入。
有时,下一次轮询需要处理的行时会返回已删除的记录。 这似乎只发生在由于达到重试限制而被删除的行上。 更令人惊讶的是,有时下一次轮询不会返回任何内容,而之后的轮询会返回已删除的行。
这是否与使用不同的连接进行读取和写入有关? 我希望所有连接立即遵守删除操作,因为我认为 myisam 使用表锁进行删除。
I have a c program running on ubuntu connecting to mysql (5.0.51a-3ubuntu5.4-log).
The programs main task is to process records from a small (<5000 rows) myisam table. If the row is processed successfully it is deleted. If not it is retried at a latter date. After a number of failed attempts it is deleted. The deletion uses the tables primary key and is plain i.e it does not specify low_priority,quick or ignore.
The program uses separate connections for reads and writes.
Occasionally a deleted record is returned by the next poll for rows that need to be processed. This appears to only happen to rows that are deleted due to reaching a retry limit. More surprisingly sometimes the next poll returns nothing and the poll after that returns the deleted row.
Is this related to using different connections for reads and writes? I expected deletes to be respected immediately by all connections since I thought myisam used table locks for deletes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来很像“交易”问题。 您是否尝试过如果在删除后立即显式提交会发生什么?
Sounds suspiciously like a "transaction" issue. Have you tried what happens if you explicitly commit right after the delete?