Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54592

Upgrade MongoDB cache store to use new library to be compatible with php7

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Set up

      MongoDB driver

      • Ensure the PHP mongodb extension >= 1.5 is installed.
        • Go to Site Administration > Server > PHP info and check that MongoDB support is enabled.
      • If necessary, install the PHP extension following the documentation.

      Install a MongoDB server

      MongoDB server >= 3.0 supported.

      Use the official Docker image.

      • Follow the instructions in the download page. Basically:

         $ docker run --name mongo -p 27017:27017 mongo

      • Check the ports listed for the mongo container:

         $ docker ps -a
        

      Before the patch

      1. Log in as admin.
      2. Go to Site Administration > Plugins > Caching > Configuration.
      3. Confirm that it is NOT possible to add a MongoDB instance (the link Add instance is not available on the right).

      After the patch

      1. Log in as admin.
      2. Go to Site Administration > Plugins > Caching > Configuration.
      3. Confirm that it is possible to add a MongoDB instance (the link Add instance is available on the right).
        1. If your version of PHP mongo DB extension is lower than 1.5 then the add instance link will not be available.
      4. Add a MongoDB instance:
        • Store name: MongoTEST
        • Server: mongodb://127.0.0.1:27017, 27017 should be the port of the docker instance (see above).
        • Leave the rest of the fields with the default value.
      5. Confirm that is listed in the Configured store instances section.
      6. Go to Site Administration > Plugins > Caching > Cache stores.
      7. In the MongoDB Test server add the connection string of the server created before. If you are using the Docker image, the connection string will be mongodb://127.0.0.1:27017, where 27017 should be the port of the docker instance (see above).
      8. Go to Site Administration > Plugins > Caching > Test performance.
      9. Confirm that the MongoDB cache store is tested as application and session cache.
      Show
      Set up MongoDB driver Ensure the PHP mongodb extension >= 1.5 is installed. Go to Site Administration > Server > PHP info and check that MongoDB support is enabled. If necessary, install the PHP extension following the documentation . Install a MongoDB server MongoDB server >= 3.0 supported. Use the official Docker image . Follow the instructions in the download page. Basically:  $ docker run --name mongo -p 27017:27017 mongo Check the ports listed for the mongo container:  $ docker ps -a Before the patch Log in as admin. Go to Site Administration > Plugins > Caching > Configuration . Confirm that it is NOT possible to add a MongoDB instance (the link Add instance is not available on the right). After the patch Log in as admin. Go to Site Administration > Plugins > Caching > Configuration . Confirm that it is possible to add a MongoDB instance (the link Add instance is available on the right). If your version of PHP mongo DB extension is lower than 1.5 then the add instance link will not be available. Add a MongoDB instance: Store name : MongoTEST Server : mongodb://127.0.0.1:27017, 27017 should be the port of the docker instance (see above). Leave the rest of the fields with the default value. Confirm that is listed in the Configured store instances section. Go to Site Administration > Plugins > Caching > Cache stores . In the MongoDB Test server add the connection string of the server created before. If you are using the Docker image, the connection string will be mongodb://127.0.0.1:27017 , where 27017 should be the port of the docker instance (see above). Go to Site Administration > Plugins > Caching > Test performance . Confirm that the MongoDB cache store is tested as application and session cache.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-54592-master

      Description

      The MongoDB PHP Library and underlying mongodb extension have notable API differences from the legacy mongo extension.

      While installing and running php7 unit test, the new mongodb extension is installed via pecl and the unit test get skipped.

      Here is the upgrade guide

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours, 30 minutes
                  1d 4h 30m