forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit55b7e2f
committed
Fix two bugs in MaintainOldSnapshotTimeMapping.
The previous coding was confused about whether head_timestamp wasintended to represent the timestamp for the newest bucket in themapping or the oldest timestamp for the oldest bucket in the mapping.Decide that it's intended to be the oldest one, and repairaccordingly.To do that, we need to do two things. First, when advancing to anew bucket, don't categorically set head_timestamp to the newtimestamp. Do this only if we're blowing out the map completelybecause a lot of time has passed since we last maintained it. Ifwe're replacing entries one by one, advance head_timestamp by1 minute for each; if we're filling in unused entries, don'tadvance head_timestamp at all.Second, fix the computation of how many buckets we need to advance.The previous formula would be correct if head_timestamp were thetimestamp for the new bucket, but we're now making all the codeagree that it's the timestamp for the oldest bucket, so adjust theformula accordingly.This is certainly a bug fix, but I don't feel good aboutback-patching it without the introspection tools added by commitaecf5ee, and perhaps also someactual tests. Since back-patching the introspection tools mightnot attract sufficient support and since there are no automatedtests of these fixes yet, I'm just committing this to master fornow.Patch by me, reviewed by Thomas Munro, Dilip Kumar, Hamid Akhtar.Discussion:http://postgr.es/m/CA+TgmoY=aqf0zjTD+3dUWYkgMiNDegDLFjo+6ze=Wtpik+3XqA@mail.gmail.com1 parentc005eb0 commit55b7e2f
1 file changed
+27
-3
lines changedLines changed: 27 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1949 | 1949 |
| |
1950 | 1950 |
| |
1951 | 1951 |
| |
1952 |
| - | |
1953 |
| - | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
1954 | 1955 |
| |
1955 |
| - | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
1956 | 1978 |
| |
1957 | 1979 |
| |
1958 | 1980 |
| |
1959 | 1981 |
| |
1960 | 1982 |
| |
1961 | 1983 |
| |
1962 | 1984 |
| |
| 1985 | + | |
1963 | 1986 |
| |
1964 | 1987 |
| |
1965 | 1988 |
| |
| |||
1978 | 2001 |
| |
1979 | 2002 |
| |
1980 | 2003 |
| |
| 2004 | + | |
1981 | 2005 |
| |
1982 | 2006 |
| |
1983 | 2007 |
| |
|
0 commit comments
Comments
(0)