superposition icon indicating copy to clipboard operation
superposition copied to clipboard

add snapshot while context , default configs updates

Open pratikmishra356 opened this issue 1 year ago • 2 comments

Problem

Record for config's history after every cac_config changes, we also encountered problem regarding generating snowflake_id, we were not dropping the acquired mutex lock, and when generating another snowflake_id , it gets stuck in deadlock kind of situation

Solution

Created config_versions table which will store the config's snapshot after every updates which affect the configs. Fetch contexts and default_configs and insert into config_Versions table after any updates within the same transaction. we are explicitly dropping acquired lock after snowflake_id generation Also accepting tags parameters in every update request so that user can tag every versions

Environment variable changes

NA

Pre-deployment activity

Create db changes

Post-deployment activity

NA

API changes

get_config apis we will now provide priority inside context objects adding optional tags field in every context, default_config and experiments updates accepting version queryparam in every get_config apis

Possible Issues in the future

NA

pratikmishra356 avatar Apr 24 '24 10:04 pratikmishra356

Can we squash all commits into one?

Datron avatar Apr 30 '24 06:04 Datron

What happens when someone tries to update tags? Is that possible?

@Datron currently this is not supported , a different api will be needed also we need to have list versions api with filter on tags support these changes can be added later on , this pr already has lot of changes

pratikmishra356 avatar May 20 '24 06:05 pratikmishra356