[SERVER-72261] Change CanChangeState::shouldCopyValue to only match bson values Created: 19/Dec/22  Updated: 07/Feb/23

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

Type: Task Priority: Minor - P4
Reporter: Anna Wawrzyniak Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

Change CanChangeState::shouldCopyValue to only match bson values.

SBE deals with 2 value sources:

  • internal: all values created and managed by SBE. Those values are pointer stable, and don't require special handling during yielding save/restore.
  • external: values that are coming from outside of SBE (like bson returned by a storage cursors). Those values might not have stable pointers and in such case require special handling (copy) during yielding save/restore.

We should limit CanChangeState::shouldCopyValue to only match the external values that have unstable pointers.



 Comments   
Comment by Anna Wawrzyniak [ 31/Jan/23 ]

I think the severity and impact of this issue is low, so probably P4 rather than P3. This is likely a good ticket for a new hire.

 

A bit more elaboration on impact and kind of queries that might be affected:

  • queries using Strings/Decimal128 manipulation (or any other sbe heap value other than Array/ArraySet/Object) might incur extra cost during save/restore, where we would make unnecessary copy of a String/Decimal.
  • query is likely going to have a small number of affected slots (like <10, rather than >100), so as long as those values are small it will not have noticeable perf impact.
Comment by Ana Meza [ 31/Jan/23 ]

Hi anna.wawrzyniak@mongodb.com during Triage we would like to know your preference and priority to resolve this ticket. 

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