From 817cf104585ef396cfad1fc7b514c458d3a0c535 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Wed, 20 Dec 2023 14:44:25 -0800 Subject: [PATCH] db: set hideObsoletePoints for "boomerang" files We weren't setting this flag correctly When a shared file is ingested by another store and then ingested back into the original store, leading to an "out of order keys" error in `TestMetaTwoInstances`. Informs #3174. --- table_cache.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/table_cache.go b/table_cache.go index e81f019620..75cf9b2919 100644 --- a/table_cache.go +++ b/table_cache.go @@ -545,10 +545,11 @@ func (c *tableCacheShard) newIters( rp = &tableCacheShardReaderProvider{c: c, file: file, dbOpts: dbOpts} } - if provider.IsSharedForeign(objMeta) { + if objMeta.IsShared() && v.reader.Properties.GlobalSeqNum != 0 { if tableFormat < sstable.TableFormatPebblev4 { - return nil, nil, errors.New("pebble: shared foreign sstable has a lower table format than expected") + return nil, nil, errors.New("pebble: shared ingested sstable has a lower table format than expected") } + // The table is shared and ingested. hideObsoletePoints = true } var categoryAndQoS sstable.CategoryAndQoS