void createOplog(OperationContext* opCtx, const std::string& oplogCollectionName, bool isReplSet) {
|
Lock::GlobalWrite lk(opCtx);
|
|
const ReplSettings& replSettings = ReplicationCoordinator::get(opCtx)->getSettings();
|
|
OldClientContext ctx(opCtx, oplogCollectionName);
|
Collection* collection = ctx.db()->getCollection(opCtx, oplogCollectionName);
|
|
if (collection) {
|
if (replSettings.getOplogSizeBytes() != 0) {
|
const CollectionOptions oplogOpts =
|
collection->getCatalogEntry()->getCollectionOptions(opCtx);
|
|
int o = (int)(oplogOpts.cappedSize / (1024 * 1024));
|
int n = (int)(replSettings.getOplogSizeBytes() / (1024 * 1024));
|
if (n != o)
|
|
{ stringstream ss; ss << "cmdline oplogsize (" << n << ") different than existing (" << o << ") see: http://dochub.mongodb.org/core/increase-oplog"; log() << ss.str() << endl; uasserted(13257, ss.str()); }
|
|
}
|