Project

Profile

Help

Issue #1043

Updated by rbarlow almost 9 years ago

Our "pulp.server.managers.repo.sync.RepoSyncManager.sync_history()":https://github.com/pulp/pulp/blob/2.4-release/server/pulp/server/managers/repo/sync.py#L291 pulp.server.managers.repo.sync.RepoSyncManager.sync_history() method sorts the repo sync history by started (start time), which is not an indexed field. This can cause MongoDB to fail to retrieve the sync history if there are too many documents in the collection with this error: 

 <pre> 
 database error: too much data for sort() with no index.    add an index or specify a smaller limit 
 </pre> 

 We can fix this by indexing the started field, but that will increase the amount of memory consumed by mongod which I think might be undesirable. A clever alternative is to sort by the MongoDB ObjectID, which isn't going to be an identical sort, but should be similar enough. This will cause us to sort by the creation time of the sync history document, rather than by the start time of the sync task. 

 If we have reservations about semantic versioning due to this proposal, we may be able to add the index for Pulp 2.Y, and drop in with Pulp 3.0 where we switch to sorting by ObjectID. I am on the fence about whether this is a semantic versioning concern. 

 https://github.com/pulp/pulp/blob/2.4-release/server/pulp/server/managers/repo/sync.py#L291

Back