From 5182bf3f83c17946887dcb3e881bd7e64bfd0aae Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Mon, 10 Oct 2022 15:07:07 -0700 Subject: [PATCH] Skip column validation for non-value types when iter_start_ts is set (#10799) Summary: When the `iter_start_ts` read option is set, iterator exposes internal keys. This also includes tombstones, which by definition do not have a value (or columns). The patch makes sure we skip the wide-column consistency check in this case. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10799 Test Plan: Tested using a simple blackbox crash test with timestamps enabled. Reviewed By: jay-zhuang, riversand963 Differential Revision: D40235628 fbshipit-source-id: 49519fb55d8fe2bb9249ced809f7a81bff2b9df2 --- db_stress_tool/no_batched_ops_stress.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index 147d6cdae..533d0b95c 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -706,6 +706,17 @@ class NonBatchedOpsStressTest : public StressTest { iter->Next()) { ++count; + // When iter_start_ts is set, iterator exposes internal keys, including + // tombstones; however, we want to perform column validation only for + // value-like types. + if (ro_copy.iter_start_ts) { + const ValueType value_type = ExtractValueType(iter->key()); + if (value_type != kTypeValue && value_type != kTypeBlobIndex && + value_type != kTypeWideColumnEntity) { + continue; + } + } + const WideColumns expected_columns = GenerateExpectedWideColumns( GetValueBase(iter->value()), iter->value()); if (iter->columns() != expected_columns) {