Improve the way of action and the event db wrote

Registered by XueFeng Liu

senlin-engine's action and event increase too fast.Such as cluster_check\node_check action and event need improve the way of db wrote.
If the action records are too many, it will cause CPU high and many other problems.

Blueprint information

Status:
Complete
Approver:
XueFeng Liu
Priority:
High
Drafter:
XueFeng Liu
Direction:
Approved
Assignee:
XueFeng Liu
Definition:
Approved
Series goal:
Accepted for pike
Implementation:
Implemented
Milestone target:
None
Started by
XueFeng Liu
Completed by
XueFeng Liu

Related branches

Sprints

Whiteboard

more details are needed on this please.

Will slove from three directions:
1.Slove increasing too fast
1)Periodic action such as cluster_check\node_check need change record policy.Such as just record error actions.
2)Use update to replace add new record in some logic.

2.Slove records too many which will cause cpu high or other problem
For example:
Add max_action_store_num\max_event_store_num configuration.
Add action_backup\event_backup table when action\event table arrive maximum, move to a new action_backup\event_backup table and write again to action\event table.

3.senlin client
Make 'timeout' optional in action/event list command.

More detail will update later.

[XueFeng 20170118]
After discussing on meetup, under things should to do.
1.When do a cluster/node check we can delete all CLUSTER_CHECK/NODE_CHECK actions which status are SUCCEEDED/FAILED.

2.When delete a cluster/node, we can delete all actions of the cluster/node excepting the delete action itself.

3.About event, we will handle with another BP:
https://blueprints.launchpad.net/senlin/+spec/db-purge-for-deleting-events

Gerrit topic: https://review.openstack.org/#q,topic:bp/s,n,z

Addressed by: https://review.openstack.org/421615
    Revise action_delete_by_target api

Gerrit topic: https://review.openstack.org/#q,topic:bp/improve-action-event,n,z

Addressed by: https://review.openstack.org/431401
    Clean action records after deleting cluster/node

Addressed by: https://review.openstack.org/435643
    Revise action_delete_by_target api

[XueFeng 20170707]
We have Implemented clean api in db and do clean patch when deleteing cluster/node.
Under patch will rewrite in another bp. Finsh this bp first.
Addressed by: https://review.openstack.org/435822
    Revise cluster/node check action records design

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.