1

Bear with me for a second here:

We have a big project, with ~50-60 clients, and 10-15 people online at any time. We are running Rails 2.3.14 on EC2 using Scalarium.

We also have various types, like Invoice, Order, Estimate, etc. which are types of the Document model. Therefore, the documents MySQL table is pretty big (over 80,000 records).

The problem we're facing is that sometimes (Document|Estimate|Order|Invoice|...).save returns true, but a corresponding object is not being created. This happens only on DocumentsController#create, obviously.

Since the response we're getting from save is true, the record should be saved into the database. But it isn't! A user is then presented with a 404, because the object wasn't created, but since save returned true, the controller redirected us to DocumentsController#show.

What could be the issue here? Is the amount of rows in one table somehow affecting INSERT INTO statements?

  • MySQL: mysql Ver 14.14 Distrib 5.1.57, for debian-linux-gnu (i486) using readline 5.1

If you need more input from my side, ask, I'll provide as much info as I can.

Michał
  • 374
  • 1
  • 3
  • 16
  • what about logs? I mean logs/development.log. You can find there SQL-request, that is really sending. May be key is there – beornborn Mar 16 '12 at 16:25
  • the logging has been enabled on production for past day only, we didn't have the errors coming in just now. And I can't replicate this error in development environment so far. – Michał Mar 16 '12 at 16:33
  • may be you have after_save callback, that deletes user. check it (but it is of course unlikely). – beornborn Mar 16 '12 at 16:42
  • May be problem in transactions? MySQL don't support them. So it could be: user saves, you got "true", than after 0.01 sec other process delete user, and it seems like user didn't create? – beornborn Mar 16 '12 at 16:46

0 Answers0