From 2078e33874e12220935be5c819db4a71b955e758 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Mon, 6 Mar 2023 19:48:15 +0000 Subject: [PATCH] spanconfig: deflake spanconfigreconcilerccl/TestDataDriven Fixes #98038. This test set up two protection records over two schema objects at two timestamps ts=3 and ts=4. /Table/10{6-7} protection_policies=[{ts: 3} {ts: 4}] /Table/10{7-8} protection_policies=[{ts: 3} {ts: 4}] When it later released those protection records: release record-id=3 release record-id=4 ---- It asserted that the span config mutations showed that we did infact get rid of the protected state: mutations ---- delete /Table/10{6-7} upsert /Table/10{6-7} range default delete /Table/10{7-8} upsert /Table/10{7-8} range default But since release of these protections was non-atomic, in #98038 we observed the following transition instead. delete /Table/10{6-7} upsert /Table/10{6-7} protection_policies=[{ts: 4}] delete /Table/10{7-8} upsert /Table/10{7-8} protection_policies=[{ts: 4}] delete /Table/10{6-7} upsert /Table/10{6-7} range default delete /Table/10{7-8} upsert /Table/10{7-8} range default That is, we first got rid of the record with ts=3 and only then got rid of ts=4. We just rewrite the test to assert on the final state of the records that show no remaining protections, instead of trying to add synchronization for mutations. Release note: None --- .../testdata/protectedts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/protectedts b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/protectedts index 00fd5c5dcb35..05c217a89a8c 100644 --- a/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/protectedts +++ b/pkg/ccl/spanconfigccl/spanconfigreconcilerccl/testdata/protectedts @@ -124,6 +124,13 @@ state limit=2 /System/NodeLiveness{-Max} ttl_seconds=600 num_replicas=5 ... +# Take another look at the remaining protected spans. +state offset=51 +---- +... +/Table/10{6-7} protection_policies=[{ts: 3} {ts: 4}] +/Table/10{7-8} protection_policies=[{ts: 3} {ts: 4}] + # Release the schema object records. release record-id=3 ---- @@ -131,9 +138,9 @@ release record-id=3 release record-id=4 ---- -mutations +# Observe that they're no longer protected. +state offset=51 ---- -delete /Table/10{6-7} -upsert /Table/10{6-7} range default -delete /Table/10{7-8} -upsert /Table/10{7-8} range default +... +/Table/10{6-7} range default +/Table/10{7-8} range default