mongod doesn't detect file system disappearance

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Cannot Reproduce
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Environment:
      Linux (Ubuntu Maverick x86_64).
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It appears that at least under some versions of Linux, if the file system disappears out from under mongod, the server will continue to operate to some degree, with the consequence that data might get written to the wrong locations and so probably lost later. Probably the server ought to abort in these cases, if it's possible to detect them.

      Reproduction case:


      #!/bin/sh
      set -e
      set -u

      p=30000
      d="`mktemp -d`"
      l="`mktemp`"
      pf="`mktemp`"
      u=localhost:$p/test
      c1='db.c.insert(

      {s:"good"}

      ); db.c.find().forEach(printjson)'
      c2='db.c.insert(

      {s:"bad"}

      ); db.c.find().forEach(printjson)'

      sudo mount -t tmpfs -o size=512M tmpfs "$d"
      trap "(set +e; sudo umount -lf \"$d\")" 0
      mongod --pidfilepath "$pf" --port $p --logpath "$l" --dbpath "$d" --fork
      trap "(set +e; kill -TERM `cat \"$pf\"`; sudo umount -lf \"$d\")" 0
      echo "Inserting some data and doing a db.c.find():"
      mongo --quiet --eval "$c1" $u
      echo -n "Unmounting file system under mongod... "
      sudo umount -lf "$d"
      trap "(set +e; kill -TERM `cat \"$pf\"`" 0
      echo "done."
      echo "Testing consequences of another insert:"
      mongo --quiet --eval "$c2" $u

      1. Uncomment for cleanup.
      2. rm -r "$l" "$d"

            Assignee:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Richard Kreuter (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: