Issue #8044
closed
no index for _last_updated on content models causes a fatal error when ordered result is queried
Status:
CLOSED - CURRENTRELEASE
Description
To ensure data correctness, Migration plugin requires fetching content in ordered way. For this _last_updated field is used.
Without index, the query ordered by that field fails due to lack of memory and complains that no index is present.
- Related to Issue #7781: In case of any issues in the middle of pre-migration, migration re-run doesn't pick up all the needed content. added
Example:
> db.units_rpm.find().sort( { _last_updated: -1 } )
Error: error: {
"ok" : 0,
"errmsg" : "Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.",
"code" : 96,
"codeName" : "OperationFailed"
}
Performance note: adding index (last_updated, -1) to all units collections, in an installation with 274 sync'd repositories comprising 259738 RPMs, took 4m30s to complete.
- Triaged changed from No to Yes
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Add index to _last_updated for ContentUnits.
fixes #8044