I dug a bit deeper, as nobody seems to have a clue either. I printed
all keynames that I retrieved from the datastore in the order they
were retrieved. I repeated this 3 times, each time calling the exact
same code. What turns out to happen is that occasionally, the GqlQuery
returns the keys in the wrong order! Suddenly, I get the LAST key in
the table and all following keys in DESCENDING order. When the
GqlQuery randomly flips back to normal, it then goes in ASCENDING
order but from almost at the end of the table.
The peculiar thing is that this seems to happen at a particular
position in the table each time. The start of the key reversing seems
random, but the last 500 are always the same. I'm wondering if the
index is broken and that causes the problem, cause I seriously can't
think of any other explanation.
Just to say, I have a custom descending index on the key_name for this
class, if that makes any difference.
Can someone from Google please look into this?
Thanks,
Ben