Closed johartl closed 8 years ago
@johartl thanks for the info, its a known issue we are working on
@sacdallago it seems that the reason for this is that we don't have an index over the "time" attribute of our sightings => sorting has to be done in memory for 2,5 million sightings => buffer overflow. However we defined an index for "time" and we don't know why it is not there. If we try to create the index now, it fails because of duplicates so we can either try to drop duplicates or drop the whole collection and start from scratch (which would be the easiest solution)
Define start from scratch.
This is what i mean: drop the "pokemonsightings" collection which has ~2.5 million sightings and was the result of running the scrapers for around 12 hours until we hit the storage limit on the mlab instance. Then restart the listening process so that the index for the time attribute gets created and no more buffer overflow when someone requests sightings from our API. Of course i already did a backup of that on my local machine in case someone cries for more data. For a temporary fix i created a new index that ignores duplicates and the api request seem to work now. But as soon as our DB migrates to a bigger instance (on some rostlab server) i would say we start with a new collection to make sure that we have the right index.
@jonas-he we can also export the data we have till now in a dump and start anew on the mlab servers. The rostlab server is still giving me all the issues it possibly can, it's starting to become annoying
@sacdallago yes we could start anew on the mlab servers, but we would still have the storage limit. only difference to the collection that we now have would be that we will have the index {"appearedOn": -1, "pokemonId": 1, "location": 1}, {"unique": true}
instead of just {"appearedOn": -1}
(which i created manually to fix the API error temporarily). So no big benefit apart from having no duplicates. I would suggest to wait for rostlab and then start from new.
curl http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/sighting/