What had been happening was related to the fact that ATOMIC_REQUESTS is now on, preventing writing to the database until a request is completed. The problem with that was that CohortMemberships, with their explicit transaction handling, were breaking that rule and touching the database. The CohortMembership needs to also touch the database to update the underlying course_user_groups information, to prevent the database from getting into a strange state. After this commit, every time a CohortMembership is updated or created, the corresponding course_user_groups are also updated and explicitly written to the database. This occurs atomically with the CohortMembership, and does not wait for the end of the request.
Open edX -------- This is the root package for Open edX. The intent is that all importable code from Open edX will eventually live here, including the code in the lms, cms, and common directories. Note: for now the code is not structured like this, and hence legacy code will continue to live in a number of different packages. All new code should be created in this package, and the legacy code will be moved here gradually.