Loading ...
Sorry, an error occurred while loading the content.

1147Re: Vote API disabled for the moment

Expand Messages
  • Maurizio
    Feb 24, 2013
      Hello Josh,

      first, thank you for your awesome work.
      I wanted to ask if you'll enable vote_voter for v2 as well :)

      Cheers,
      Maurizio

      --- In govtrack@yahoogroups.com, Josh Tauberer <tauberer@...> wrote:
      >
      > Hey, Kent.
      >
      > On the up-side, it wasn't you. The culprit was paying attention and sent
      > an email soon after the API started returning 404s. :)
      >
      > I'm afraid to turn the v1 API back on because the framework I used for
      > it (Tastypie in Django) doesn't give me much control over the queries.
      >
      > You can switch to the v2 API which works mostly the same. Just
      > substitute v2 for v1, and check the field names still line up. In the v2
      > API, I've blocked the sort of query that was the problem.
      >
      > Basically, when you have an OFFSET that's too large MySQL decides it
      > doesn't need to worry about query optimization anymore, and it executes
      > the query without the use of the key that it uses normally. The problem
      > was triggered by any offset >= 157191. Unfortunately since the SQL
      > itself is still generated by Django, I can't do any further optimization
      > (like adding FORCE INDEX, which does work).
      >
      > I've made it so the v2 API won't let you set a high offset, so at least
      > this problem is avoided.
      >
      > The v2 API also has better error checking. In fact, when there's an
      > error it reports the error to the caller rather than sending an email to
      > me. (Improvement!) It is also more cautious about what to allow to
      > prevent other runaway queries, so some previously possible queries with
      > complex filters or unusual ordering may by rejected by v2.
      >
      > This issue only affects the two votes-related APIs because those were
      > the only APIs that were backed by MySQL. Bills and people APIs are
      > backed by Solr (and so probably have different undiscovered issues).
      >
      > Feedback on v2 welcome, etc.
      >
      > - Josh Tauberer (@JoshData)
      >
      > http://razor.occams.info
      >
      > On 02/21/2013 03:26 PM, maplight_kent wrote:
      > >
      > >
      > > Can we do anything to help get it back online? We have some MySQL folks who might be able to optimize the culprit queries.
      > >
      > > If it was our calls, I'll double-check that we're not pulling more data than necessary.
      > >
      > > Kent
      > >
      > > --- In govtrack@yahoogroups.com, Josh Tauberer <tauberer@> wrote:
      > >> Someone's queries to the votes API were bringing down my whole server,
      > >> so I've disabled the two votes endpoints for the moment.
      > >>
      > >> MySQL wasn't optimizing a query very well, to say the least.
      > >>
      > >> --
      > >> - Josh Tauberer (@JoshData)
      > >>
      > >> http://razor.occams.info
      > >>
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      >
    • Show all 10 messages in this topic