Ah, Igor tells me what happened. Sorry for the confusion. You can read on
if you're interested.


It turns out that it's challenging to write a scalable scoreboard in App
Engine, because it doesn't natively support a sub-linear "what's my rank in
this query?" or "Give me people N through N+24 from this query" operation,
and the way we retrieve our scoreboard is by querying by (points
descending, penalty ascending). However, App Engine *does* support "Give me
the 25 people with the highest scores below score X" in sublinear time.

So to solve this problem, we use a 100-ary range tree called the Google App
Engine Ranklist <https://code.google.com/p/google-app-engine-ranklist/>,
which was written for Code Jam. This lets us say "tell me the number of
points and penalty minutes the person in rank N has" in O(1) datastore
transactions.

Because so many contestants can submit at the same time, we can't have our
ranklist be updated the instant you submit, or else there would be a lot of
transactional contention to update those App Engine datastore Entities.
Instead, when you submit we mark your scoreboard row "dirty", and we have a
cron job that comes along and "cleans" a bunch of rows at once. To clean a
row, we mark it no longer dirty, and we update the ranklist with your new
score.

Our cron job was written before App Engine had cron, and (since we're all
working on this in our 20% time)  and we haven't gotten around to fixing
that. :-) The job was running in a datacentre that went down for scheduled
maintenance near the end of the contest, and (because the job was
configured around 7 years ago) wasn't properly configured to come back up
somewhere else. Igor had to scramble to get another instance running, but
between when the job went down and when that happened, the scoreboard
started showing weird things.

To fix this, for now we'll make the simple config change to our job that
will make it pop up in a new datacentre if the old one goes down. In the
longer term we want to port it to App Engine cron.

TL;DR: Ancient job goes down, ancient configuration doesn't tell it to go
back up. Ancient job is in charge of the scoreboard. Ancient job needs some
attention, which we're about to give it.

Cheers, and thanks for pointing it out!
Bartholomew


On Mon, May 12, 2014 at 9:55 AM, Pedro Osório <[email protected]>wrote:

> Bartholomew, I can confirm this. I was 5xxth at the end of the round 1C
> and now I am 644th.
>
> On Monday, 12 May 2014 09:53:08 UTC-7, Bartholomew Furrow  wrote:
> > srikkbhat, are you referring to Round 1B? That scoreboard changed after
> the end of the contest when we identified contestants who had broken the
> rules, or had submitted the wrong code. If it's Round 1C, that hasn't
> happened yet, so if it changed after the end of the contest that would be
> surprising. :-)
> >
> >
> >
> >
> >
> > On Sun, May 11, 2014 at 5:03 PM, srikkbhat <[email protected]> wrote:
> >
> >
> > I could see the scores are being modified. Anyone knows why?
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" 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/google-code/a387efef-fe40-4a58-937e-a9875081f777%40googlegroups.com
> .
> >
> >
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" 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/google-code/2569d688-7764-4983-8dab-553ec220007f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" 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/google-code/CAHaiWHM2%3DmeAtU8o3kiS0dZPgCBUTAKnXOt%3DA1RWtju2FTXJSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to