0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

dur make fixes

This commit is contained in:
dwight 2010-11-27 16:14:47 -05:00
parent fe11f8506b
commit 278fba2dd4
8 changed files with 14 additions and 8 deletions

View File

@ -156,7 +156,7 @@ namespace mongo {
if ( l > a )
a = l + 16 * 1024;
if ( a > BufferMaxSize )
msgasserted(10000, "BufBuilder grow() > 64MB");
msgasserted(13548, "BufBuilder grow() > 64MB");
data = (char *) realloc(data, a);
size= a;
}

View File

@ -20,7 +20,7 @@ namespace mongo {
inline void* writingAtOffset(void *buf, unsigned ofs, unsigned len) { return buf; }
template <typename T> inline T* alreadyDeclared(T *x) { return x; }
inline void declareWriteIntent(void *, unsigned) { }
void createdFile(string filename, unsigned long long len) { }
inline void createdFile(string filename, unsigned long long len) { }
#else
/** call during startup so durability module can initialize

View File

@ -209,7 +209,7 @@ namespace mongo {
uassert(13534, str::stream() << "recovery error couldn't open " << fn, p);
if( cmdLine.durTrace & CmdLine::DurDumpJournal )
log() << " opened " << fn << ' ' << f->length()/1024.0/1024.0 << endl;
uassert(10000, str::stream() << "recovery error file has length zero " << fn, f->length());
uassert(13543, str::stream() << "recovery error file has length zero " << fn, f->length());
assert( ofs < f->length() );
}
@ -312,7 +312,7 @@ namespace mongo {
log() << "recover " << journalfile.string() << endl;
MemoryMappedFile f;
void *p = f.mapWithOptions(journalfile.string().c_str(), MongoFile::READONLY | MongoFile::SEQUENTIAL);
massert(10000, str::stream() << "recover error couldn't open " << journalfile, p);
massert(13544, str::stream() << "recover error couldn't open " << journalfile, p);
return _apply(p, (unsigned) f.length());
}
@ -331,7 +331,7 @@ namespace mongo {
close();
if( cmdLine.durTrace & CmdLine::DurScanOnly ) {
uasserted(10000, str::stream() << "--durTrace " << CmdLine::DurScanOnly << " specified, terminating");
uasserted(13545, str::stream() << "--durTrace " << CmdLine::DurScanOnly << " specified, terminating");
}
log() << "recover cleaning up" << endl;

View File

@ -40,7 +40,7 @@ namespace mongo {
op = shared_ptr<DurOp>( new FileCreatedOp(br) );
break;
default:
massert(10000, str::stream() << "dur recover unrecognized opcode in journal " << hex << opcode, false);
massert(13546, str::stream() << "dur recover unrecognized opcode in journal " << hex << opcode, false);
}
return op;
}
@ -90,7 +90,7 @@ namespace mongo {
log() << "recover create file " << _filename << ' ' << _len/1024.0/1024.0 << "MB" << endl;
File f;
f.open(_filename.c_str());
massert(10000, str::stream() << "recover couldn't create file " << _filename, f.is_open());
massert(13547, str::stream() << "recover couldn't create file " << _filename, f.is_open());
unsigned long long left = _len;
const unsigned blksz = 64 * 1024;
scoped_ptr<char> v( new char[blksz] );

View File

@ -207,7 +207,8 @@ namespace mongo {
}
/*virtual*/ void MongoMMF::close() {
if( durable ) {
#if defined(_DURABLE)
{
// we must first commit anything pending before unmapping views.
if( !testIntent ) {
dbMutex.assertAtLeastReadLocked();
@ -218,6 +219,7 @@ namespace mongo {
ourReadViews.remove(_view_readonly);
}
}
#endif
_view_write = _view_private = _view_readonly = 0;
MemoryMappedFile::close();
}

View File

@ -210,10 +210,12 @@ namespace mongo {
}
inline void MongoMutex::_acquiredWriteLock() {
#if defined(_DURABLE)
if( _remapPrivateViewRequested ) {
dur::REMAPPRIVATEVIEW();
dassert( !_remapPrivateViewRequested );
}
#endif
}
/* @return true if was already write locked. increments recursive lock count. */

View File

@ -201,6 +201,7 @@
<ClInclude Include="..\db\dur_journal.h" />
<ClInclude Include="..\db\jsobjmanipulator.h" />
<ClInclude Include="..\db\mongommf.h" />
<ClInclude Include="..\db\mongomutex.h" />
<ClInclude Include="..\pcre-7.4\pcrecpp.h" />
<ClInclude Include="..\targetver.h" />
<ClInclude Include="..\..\boostw\boost_1_34_1\boost\version.hpp" />

View File

@ -237,6 +237,7 @@
<Filter>dur</Filter>
</ClInclude>
<ClInclude Include="..\db\durop.h" />
<ClInclude Include="..\db\mongomutex.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\..\js\js64r.lib">