mirror of
https://github.com/pgsty/minio.git
synced 2026-11-10 17:45:32 +03:00
Integrate scanner rejection contract regression
Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -522,10 +522,20 @@ func TestPoolsDeleteVersionSpecialCalls(t *testing.T) {
|
|||||||
opts := ObjectOptions{Versioned: true, VersionID: oi.VersionID, InclFreeVersions: !expiration, Expiration: ExpirationOptions{Expire: expiration}}
|
opts := ObjectOptions{Versioned: true, VersionID: oi.VersionID, InclFreeVersions: !expiration, Expiration: ExpirationOptions{Expire: expiration}}
|
||||||
_, err := z.DeleteObject(t.Context(), bucket, object, opts)
|
_, err := z.DeleteObject(t.Context(), bucket, object, opts)
|
||||||
if expiration {
|
if expiration {
|
||||||
// No lifecycle rule authorizes expiration. Preserve its existing
|
// No rule authorizes expiration. Distinguish refusal from real
|
||||||
// version-not-found result, even with an unrelated unreadable pool.
|
// absence, even with an unrelated unreadable pool, so a worker
|
||||||
if !isErrVersionNotFound(err) {
|
// cannot acknowledge or replicate a purge that never happened.
|
||||||
t.Errorf("expiration changed its scanner contract: %v", err)
|
if !errors.Is(err, errLifecycleNotApplicable) {
|
||||||
|
t.Errorf("expiration did not preserve its rejection: %v", err)
|
||||||
|
}
|
||||||
|
gr, err := z.serverPools[0].GetObjectNInfo(t.Context(), bucket, object, nil, nil, ObjectOptions{VersionID: oi.VersionID})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
data, err := io.ReadAll(gr)
|
||||||
|
gr.Close()
|
||||||
|
if err != nil || string(data) != "payload" || gr.ObjInfo.VersionID != oi.VersionID {
|
||||||
|
t.Errorf("rejected expiration changed the stored version: %v", err)
|
||||||
}
|
}
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
t.Errorf("free-version cleanup was forced through all-pool resolution: %v", err)
|
t.Errorf("free-version cleanup was forced through all-pool resolution: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user