edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

feat!: Drop the block_structure.storage_backing_for_cache WaffleSwitch

Open feanil opened this issue 1 year ago • 1 comments

This work is part of DEPR https://github.com/openedx/public-engineering/issues/32

See the above link for rational. This PR make is so that the course structure cache is always backed by persistent storage.

BREAKING CHANGE: The block_structure.storage_backing_for_cache will no longer exist and its value will be ignored. If you have this switch set in your instance you can remove it. The backing cache is now always ON.

Unresolved Questions

Q: Do we need to run any commands to generate the initial cache for all existing operators? Are there docs we can link to or create for this?

A: Unclear but, as a part of the get method on the BlockStructureStore if the structure is not found in the cache/storage, it wll be retrieved from the backing store and added to the cache. But currently the same check is not happening for getting the structure from the model. Should we update this? I think operators will need to run the generate_course_blocks management command before they deploy this code or the will see errors in their deployment.

eg. ./manage.py lms generate_course_blocks --all_courses --settings=devstack

feanil avatar Jul 25 '24 20:07 feanil

@ormsbee per our conversation last week, I dug a bit deeper into the query count differences and it looks like a lot of the extra queries are savepoints around updating a block blockstructure and then also setting the modified date on the parent block when a block structure changes. I've collected the before and after queries for the test that changed by more than one in this file.

feanil avatar Aug 20 '24 14:08 feanil

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

edx-pipeline-bot avatar Nov 06 '24 17:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX production environment.

edx-pipeline-bot avatar Nov 06 '24 18:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

edx-pipeline-bot avatar Nov 06 '24 18:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX production environment.

edx-pipeline-bot avatar Nov 06 '24 18:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

edx-pipeline-bot avatar Nov 06 '24 19:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX production environment.

edx-pipeline-bot avatar Nov 06 '24 19:11 edx-pipeline-bot

2U Release Notice: This PR has been deployed to the edX production environment.

edx-pipeline-bot avatar Nov 06 '24 19:11 edx-pipeline-bot