Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4071

mongod doesn't detect file system disappearance

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Cannot Reproduce
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Storage
    • None
    • Linux (Ubuntu Maverick x86_64).
    • Storage Execution

    Description

      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"

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: