Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
We have a potential race condition if we try to reset fullGC database variables from oak-run while fullGC is already running.
fullGCTimeStamp & fullGCId are database properties inside settings collection under versionGC document which would gets overridden if we reset fullGC from oak-run if it is still running.
The flow is like this:
- Full GC is running normally.
- We reset the variables externally let's say via oak-run.
- Oak run removes the variables fullGCTimeStamp & fullGCId from database.
- Once the normal cycle of fullGC finishes, it will again add/update those variables, which would nullify the effect of reset.
To fix this, we need to replace the updateAndCreate API (to update full GC variables after each full GC cycle) with findAndModify, this will ensure that in case the they are already removed, they won't get added again.
Once the new cycle of GC starts, it will add them again with values of oldest modified document & its ID.
Note: This race condition won't come in case of dry-run because dry run is not supported in normal flow. We can dry run with only oak run command.
Attachments
Issue Links
- links to