[SERVER-85339] Refactor bucket_catalog_internal::insert() into 3 different functions Created: 17/Jan/24  Updated: 26/Jan/24  Resolved: 26/Jan/24

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

Type: Task Priority: Major - P3
Reporter: Damian Wasilewicz Assignee: Damian Wasilewicz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2024-01-22, Execution Team 2024-02-05
Participants:

 Description   

bucket_catalog_internal::insert has a number of different branching paths that depend on the combination of two of its parameters - AllowBucketCreation and ReopeningContext. There are three different combination of values that these parameters can take that get used in the insert writepath - with AllowBucketCreation set to kNo and no ReopeningContext, with AllowBucketCreation set to kYes and no ReopeningContext, and AllowBucketCreation set to kYes and a non-null Reopening Context. As it is, the reuse of the same function in these different contexts makes the function difficult to reason about, and in particular it became difficult to reason about changing behavior for it in the context of SERVER-79480

This ticket will split this function into three different functions, which should make each of the cases, and the function, easier to reason about and change.



 Comments   
Comment by Githook User [ 20/Jan/24 ]

Author:

{'name': 'Damian Wasilewicz', 'email': '33820523+DamianWasilewicz@users.noreply.github.com', 'username': 'DamianWasilewicz'}

Message: SERVER-85339: Refactored bucket_catalog_internal::insert into 3 separate functions (#18138)

GitOrigin-RevId: d57d728dd571c904134b802d8d92c4cc4c5255ec
Branch: master
https://github.com/mongodb/mongo/commit/968cebc0e58fd407199b6712e4ad6767919fa608

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