storage: fix missing continue in keyIndex.since

It should continue to skip following operations.

The test from rev14 to rev0 fails if it doesn't call continue and append
all revisions of the same main rev to the list.
release-2.3
Yicheng Qin 2015-09-17 19:03:31 -07:00
parent 158d6e0e03
commit 87b5143b15
2 changed files with 16 additions and 0 deletions

View File

@ -177,6 +177,7 @@ func (ki *keyIndex) since(rev int64) []revision {
// replace the revision with a new one that has higher sub value,
// because the original one should not be seen by external
revs[len(revs)-1] = r
continue
}
revs = append(revs, r)
last = r.main

View File

@ -97,6 +97,21 @@ func TestKeyIndexSince(t *testing.T) {
{17, nil},
{16, allRevs[6:]},
{15, allRevs[6:]},
{14, allRevs[5:]},
{13, allRevs[5:]},
{12, allRevs[4:]},
{11, allRevs[4:]},
{10, allRevs[3:]},
{9, allRevs[3:]},
{8, allRevs[2:]},
{7, allRevs[2:]},
{6, allRevs[1:]},
{5, allRevs[1:]},
{4, allRevs},
{3, allRevs},
{2, allRevs},
{1, allRevs},
{0, allRevs},
}
for i, tt := range tests {