You are here: Foswiki>Tasks Web>Item10990 (17 Aug 2011, SvenDowideit)Edit Attach

Item10990: mongod gets into a bad state when you rename a web to the same name/different case

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: MongoDBPlugin
Branches:
Reported By: PaulHarvey
Waiting For:
Last Change By: SvenDowideit
This is a MongoDB perl driver issue, I suspect. See https://jira.mongodb.org/browse/SERVER-3451

I want us to add an ASSERT/oops/die loudly and clearly when we try to create a new web whose name already exists as a different capitalization, because the problem is that the failure mode is very subtle and not obvious at all.

The problem is that MongoDB isn't supposed to have any databases that are the same name/different capitalisation.

Somehow with Foswiki+MongoDBPlugin+CPAN:MongoDB we are able to do that.

The symptom is that afterwards, you can't save any topics. "db assertion failed" isn't a valid hashref while strict refs...

Between Foswiki, apache, and mongod there are no logs or any clues whatsoever as to what is causing the failures on topic save.

-- PaulHarvey - 20 Jul 2011

<SvenDowideit> next to see if you can find the crash log in the error.log :(
<SvenDowideit> so we have 3 things to mitigate the risks
<SvenDowideit> 1) prevent copying to same spelling webnames
<SvenDowideit> 2) fix crash in rename (might be hard- could be timeout)
<SvenDowideit> 3) refuse to import same spelling webs - only the first happens
<SvenDowideit> (OR) 3) don't use webname as dbname, and add a hashing that converts case into some encoding
<pharvey> that sucks. We like doing mongo things in the shell. But I guess we could live.
<SvenDowideit> 3(OR) is basically a place where JOINs would totally save our bacon
<SvenDowideit> in the MySQL store i wrote, DB's had GUIDs
<SvenDowideit> so renameweb was update one row in the DB properties table

-- SvenDowideit - 20 Jul 2011

I've implemented don't import into mongo if there already exists a db of same spelling but different case but i actually can't reproduce the problem yet.

will look at the other cases too.

i'm wondering if this is a place where there is a race condition in the store / listener API - in that the leases for the oldwebname may well have been removed already, but another process could still write

-- SvenDowideit - 20 Jul 2011

I'm getting this error on _template webs:

 importing: 
_TrinBlog: 21.10
0.47user 0.06system 0:01.04elapsed 50%CPU (0avgtext+0avgdata 174624maxresident)k
248inputs+40outputs (0major+11017minor)pagefaults 0swaps
FORKING a new /MongoDBPlugin/update for _TrinBlog/Comments (16) -revision=1
Invalid web at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Func.pm line 103.
 at /usr/share/perl5/CGI/Carp.pm line 354
   CGI::Carp::realdie('Invalid web at /usr/local/src/wiki.trin.org.au/core/lib/Foswi...') called at /usr/share/perl5/CGI/Carp.pm line 435
   CGI::Carp::die('Invalid web') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Func.pm line 103
   Foswiki::Func::_validateWTA('_TrinBlog/Comments') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Func.pm line 1463
   Foswiki::Func::getTopicList('_TrinBlog/Comments') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Plugins/MongoDBPlugin.pm line 212
   Foswiki::Plugins::MongoDBPlugin::updateWebCache('_TrinBlog/Comments', 1) called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Plugins/MongoDBPlugin.pm line 182
   Foswiki::Plugins::MongoDBPlugin::_update('Foswiki=HASH(0x1e85230)', 'MongoDBPlugin', 'update', 'Foswiki::Response=HASH(0x1eca5b8)') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Func.pm line 665
   Foswiki::Func::__ANON__('Foswiki=HASH(0x1e85230)', 'MongoDBPlugin', 'update', 'Foswiki::Response=HASH(0x1eca5b8)') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/UI/Rest.pm line 249
   Foswiki::UI::Rest::rest('Foswiki=HASH(0x1e85230)') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/UI.pm line 316
   Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x1e6e280)', 'HASH(0x1e8bd98)') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/UI.pm line 435
   Foswiki::UI::_execute('Foswiki::Request=HASH(0x1e6ea18)', 'CODE(0x1e6e670)', 'rest', 1, 'command_line', 1) called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/UI.pm line 274
   Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x1e6ea18)') called at /usr/local/src/wiki.trin.org.au/core/lib/Foswiki/Engine/CLI.pm line 53
   Foswiki::Engine::CLI::run('Foswiki::Engine::CLI=HASH(0x17d83b0)') called at ./rest line 29.
0.36user 0.04system 0:00.61elapsed 65%CPU (0avgtext+0avgdata 166448maxresident)k
0inputs+40outputs (0major+10485minor)pagefaults 0swaps

Added to this task because it's web-name related

-- PaulHarvey - 22 Jul 2011

closing this, as we don't use webnames as mongodb database names anymore, we abstract by using a hash :/

-- SvenDowideit - 17 Aug 2011

 

ItemTemplate edit

Summary mongod gets into a bad state when you rename a web to the same name/different case
ReportedBy PaulHarvey
Codebase trunk
SVN Range
AppliesTo Extension
Component MongoDBPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins MongoDBPlugin:45cbb0a24ff9 MongoDBPlugin:443bbd9bb68d distro:884a1f145aae MongoDBPlugin:061b163361e0 MongoDBPlugin:744a043cb254
TargetRelease n/a
ReleasedIn n/a
Topic revision: r9 - 17 Aug 2011, SvenDowideit
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy