cloudfoundry/vcap-services — pull request #28 by mflu (2013-03-20 13:14:18+00:00)
Title: [services-ng] add xlog enforcement for postgresql service

1. Add a periodical timer to check the xlog file number, interval is 1 second
- non-wardenized case: only write a warnning in the log
- wardenized case:
1) if xlog_file_num in [ 3 * checkpoint_segments + 2, 4*checkpoint_segments + 2),
issue a force checkpoint, try to delete unneeded segment files
2) if xlog_file_num in [ 4*checkpoint_segments + 2, ~) after a continous 5 (xlog_enforce_tolerance) times check,
terminate the connections from applications (won't terminate the super user and default users)
- note:
- only for oss postgresql (checkpoint_segments_max is not provided.) and plan
are sensitive to storage overhead for xlog files
- this is a trade-off of performance and storage
provide more storage for xlog is preferred.
- this enforcer could be disabled
- xlog_enforce_tolerance could be tuned.
2. Varz will include the xlog file number information