Cache r/o API requests to OS components during constraint validation
The basic use case that we need to improve is the following:
1. User prepares a template with N stacks that use the same resource (image, flavor, keypair, etc)
2. User requests Heat to create the stack
3. During custom constraint validation for every resource Heat does the following:
- Find appropriate class that validates custom constraint
- Request the other clients about constraint (check that the volume, server, flavor, etc exists)
- If request was successful then pass validation.
This approach leads to some overhead because we need to request the same info several times. In addition, current realization doubles this overhead because we are checking constraints twice (for resource validation and stack validation).
So the desired use case is the following:
1. User prepares a template with N stacks that use the same resource (image, flavor, keypair, etc)
2. User requests Heat to create the stack
3. During custom constraint validation for every resource Heat does the following:
- Find appropriate class that validates custom constraint
- Request client plugin about validation data
- Check client plugin cache and try to find result of API request with the same resource name (volume name, server, flavor, etc)
- If no results is in cache then request other clients about volume, server, flavor and store the result in cache
- Pass validation if no exceptions were raised
Perhaps there are some additional conditions that I need to consider. So I am looking forward for your feedback.
Blueprint information
- Status:
- Complete
- Approver:
- Angus Salkeld
- Priority:
- Medium
- Drafter:
- Kairat Kushaev
- Direction:
- Needs approval
- Assignee:
- Kairat Kushaev
- Definition:
- Approved
- Series goal:
- Accepted for liberty
- Implementation:
- Implemented
- Milestone target:
- 5.0.0
- Started by
- Kairat Kushaev
- Completed by
- Kairat Kushaev
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Improve constraint validation performance
Gerrit topic: https:/
Addressed by: https:/
Add dogpile cache core and turn on caching
Addressed by: https:/
[WIP!!] Enable caching for validation constraints