On Thursday, August 14, 2014 11:29:18 AM UTC-7, Hassan Schroeder wrote:
>
> On Wed, Aug 13, 2014 at 2:32 PM, Zeb Haradon <[email protected] 
> <javascript:>> wrote: 
> > Summary: rails app using postgres randomly gets into a state where 
> hstore 
> > array is returned as a string, and cannot be fixed without rebuilding 
> the 
> > database 
>
> Not that familiar with (or fond of) postgres, but curious -- 
>
> > You can see that in the broken instance, it is returning the hstore data 
> as 
> > a string. Some pertinent info is that once it gets in this broken state, 
> you 
> > can drop and restore the database, or rename the database, and as long 
> as 
> > it's on the same postgres sever, it's still broken - you have to rebuild 
> the 
> > whole database for it to work. 
>
> What is the difference exactly between "drop and restore" and 
> "rebuild"? 
>

Sorry, I misspoke. I meant that once the problem occurs you have to 
actually reinstall postgres to get it to work again. So we drop and restore 
the database, hundreds of times, with no failure, then one day the same 
thing causes a failure. After that, even after dropping and restoring the 
database, hstore arrays are still returned as strings, for every database 
on the server. Then postgres is reinstalled, and it starts working again. 
Simply reinstalling the hstore extension is not enough to fix the problem - 
the whole postgres instance must be reinstalled.
 

>
> > And if you point the app (change 
> > database.yml) to point to a different server, it works. 
>
> What's in the postgres logs when this fails? Is there anything in the 
> Rails logs at startup that differs between working/not working? 
>

Nothing useful beyond that it's returning the hstore array as a string, 
nothing that tells us why. The cleanest log info is the info from the irb 
log I posted.
 

>
> Have you put any additional logging into the connection adapter? 
>
>
Not yet but the thing I'm trying to figure out how to do now is just repro 
the problem. I've repeated the deployment process hundreds of times with no 
repro... it works and works and works then the same thing fails.
 

> -- 
> Hassan Schroeder ------------------------ [email protected] 
> <javascript:> 
> http://about.me/hassanschroeder 
> twitter: @hassan 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7c60723d-243f-45ed-9fa9-2d9b22c2d297%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to