NSLS-II / metadatastore

DEPRECATED: Incorporated into https://github.com/NSLS-II/databroker
Other
2 stars 11 forks source link

OperationalFailure on *first* call to restored mongo database #198

Closed danielballan closed 8 years ago

danielballan commented 8 years ago

I'm leaving this here for the record.

In [21]: new = mds.mds.MDSRO({'host': 'xf11id-srv1', 'port': 29000, 'database': 'datastore', 'timezone': 'US/Eastern'})  # never been queried from Python before

In [22]: next(new.find_run_starts(uid='58264b16-e628-47e5-a009-3fb83d7f7565'))

OperationFailure: command SON([('createIndexes', u'run_start'), ('indexes', [{'unique': True, 'name': u'uid_-1', 'key': SON([(u'uid', -1)])}])]) on namespace datastore.$cmd failed: Index with name: uid_-1 already exists with different options

In [23]: next(new.find_run_starts(uid='58264b16-e628-47e5-a009-3fb83d7f7565'))  # works this time
tacaswell commented 8 years ago

does the dump/reload transfer information on what the indcies should be? Can you look to see what indexes are there?

danielballan commented 8 years ago

New drivers don't like redundant ascending and descending indexes. We dropped the indexes on runstart, and now all is well. (MDS recreates these indexes now, and least the database in a good state.)