[SERVER-67327] CanonicalQueryEncoderTest is not testing the SBE plan cache key when calling testComputeSBEKey Created: 16/Jun/22  Updated: 27/Oct/23  Resolved: 20/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Rui Liu Assignee: Backlog - Query Execution
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 Description   

The current CanonicalQueryEncoderTest doesn’t seem to be exercising SBE plan cache key when calling testComputeSBEKey, due to calling the wrong function.

When trying to call the correct function on the existing test, it segfaults with the following stacktrace when trying to get shardVersion:

{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664D366106","b":"7F664D18A000","o":"1DC106","s":"_ZN5mongo18stack_trace_detail12_GLOBAL__N_119printStackTraceImplERKNS1_7OptionsEPNS_14StackTraceSinkE","C":"mongo::stack_trace_detail::(anonymous namespace)::printStackTraceImpl(mongo::stack_trace_detail::(anonymous namespace)::Options const&, mongo::StackTraceSink*)","s+":"126"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664D3670D7","b":"7F664D18A000","o":"1DD0D7","s":"_ZN5mongo15printStackTraceEv","C":"mongo::printStackTrace()","s+":"27"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664D362C57","b":"7F664D18A000","o":"1D8C57","s":"abruptQuitWithAddrSignal","s+":"1A7"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664B4FF980","b":"7F664B4ED000","o":"12980","s":"funlockfile","s+":"50"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F6650309673","b":"7F66502CC000","o":"3D673","s":"_ZN4absl12lts_2021032418container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN5mongo22OperationShardingState19ShardVersionTrackerEEENSA_15StringMapHasherENSA_11StringMapEqESaISt4pairIKS9_SC_EEE4findIS9_EENSK_8iteratorERKT_","C":"absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, mongo::OperationShardingState::ShardVersionTracker>, mongo::StringMapHasher, mongo::StringMapEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mongo::OperationShardingState::ShardVersionTracker> > >::iterator absl::lts_20210324::container_internal::raw_hash_set<absl::lts_20210324::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, mongo::OperationShardingState::ShardVersionTracker>, mongo::StringMapHasher, mongo::StringMapEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, mongo::OperationShardingState::ShardVersionTracker> > >::find<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)","s+":"43"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F6650308B76","b":"7F66502CC000","o":"3CB76","s":"_ZN5mongo22OperationShardingState15getShardVersionERKNS_15NamespaceStringE","C":"mongo::OperationShardingState::getShardVersion(mongo::NamespaceString const&)","s+":"16"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F6650419C3C","b":"7F6650404000","o":"15C3C","s":"_ZN5mongo17plan_cache_detail12_GLOBAL__N_122computeCollectionStateEPNS_16OperationContextERKNS_13CollectionPtrEb","C":"mongo::plan_cache_detail::(anonymous namespace)::computeCollectionState(mongo::OperationContext*, mongo::CollectionPtr const&, bool)","s+":"5C"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F66504196A6","b":"7F6650404000","o":"156A6","s":"_ZN5mongo17plan_cache_detail7makeSBEERKNS_14CanonicalQueryERKNS_26MultipleCollectionAccessorE","C":"mongo::plan_cache_detail::makeSBE(mongo::CanonicalQuery const&, mongo::MultipleCollectionAccessor const&)","s+":"56"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F6650419EE6","b":"7F6650404000","o":"15EE6","s":"_ZN5mongo17plan_cache_detail4makeERKNS_14CanonicalQueryERKNS_13CollectionPtrENS0_15PlanCacheKeyTagINS_3sbe12PlanCacheKeyEEE","C":"mongo::plan_cache_detail::make(mongo::CanonicalQuery const&, mongo::CollectionPtr const&, mongo::plan_cache_detail::PlanCacheKeyTag<mongo::sbe::PlanCacheKey>)","s+":"56"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"564B33E96893","b":"564B33ACB000","o":"3CB893","s":"_ZN5mongo12_GLOBAL__N_117testComputeSBEKeyEPKcS2_S2_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt10unique_ptrINS_18FindCommandRequestESt14default_deleteISA_EESt6vectorINS_7BSONObjESaISF_EE","C":"mongo::(anonymous namespace)::testComputeSBEKey(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::unique_ptr<mongo::FindCommandRequest, std::default_delete<mongo::FindCommandRequest> >, std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> >)","s+":"343"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"564B33E9323C","b":"564B33ACB000","o":"3C823C","s":"_ZN5mongo12_GLOBAL__N_164UnitTest_SuiteNameCanonicalQueryEncoderTestTestNameComputeKeySBE7_doTestEv","C":"mongo::(anonymous namespace)::UnitTest_SuiteNameCanonicalQueryEncoderTestTestNameComputeKeySBE::_doTest()","s+":"18C"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664F8528C9","b":"7F664F815000","o":"3D8C9","s":"_ZN5mongo8unittest4Test3runEv","C":"mongo::unittest::Test::run()","s+":"19"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"564B33E92FDE","b":"564B33ACB000","o":"3C7FDE","s":"_ZNSt17_Function_handlerIFvvEZN5mongo8unittest4Test17RegistrationAgentINS1_12_GLOBAL__N_164UnitTest_SuiteNameCanonicalQueryEncoderTestTestNameComputeKeySBEEEC1EPKNS2_8TestInfoEEUlvE_E9_M_invokeERKSt9_Any_data","C":"std::_Function_handler<void (), mongo::unittest::Test::RegistrationAgent<mongo::(anonymous namespace)::UnitTest_SuiteNameCanonicalQueryEncoderTestTestNameComputeKeySBE>::RegistrationAgent(mongo::unittest::TestInfo const*)::{lambda()#1}>::_M_invoke(std::_Any_data const&)","s+":"4E"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664F854217","b":"7F664F815000","o":"3F217","s":"_ZN5mongo8unittest5Suite3runERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_i","C":"mongo::unittest::Suite::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)","s+":"4D7"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664F855C33","b":"7F664F815000","o":"40C33","s":"_ZN5mongo8unittest5Suite3runERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKS8_SE_i","C":"mongo::unittest::Suite::run(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)","s+":"6C3"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F6651F06431","b":"7F6651F01000","o":"5431","s":"main","s+":"D11"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"7F664B11DC87","b":"7F664B0FC000","o":"21C87","s":"__libc_start_main","s+":"E7"}}}
{"t":{"$date":"2022-06-17T12:48:32.293Z"},"s":"I",  "c":"CONTROL",  "id":31445,   "ctx":"main","msg":"Frame","attr":{"frame":{"a":"564B33E8F36A","b":"564B33ACB000","o":"3C436A","s":"_start","s+":"2A"}}}



 Comments   
Comment by Rui Liu [ 20/Jun/22 ]

As part of this PR, we have modified the test to not test the plan cache key but only the query encoding instead. So I think this issue can be closed.

Generated at Thu Feb 08 06:07:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.