Properly handle sent_notifications records copy according to cells guidelines
Whenever we close/copy issues, we also copy/clone it's related data. We copy records from the sent_notifications table, and we need to make sure they are recreated in the target without modifying the sharding key.
Notes
- We probably don't need to copy sent_notifications records when cloning as associated notifications for the new issue have never been sent out.
- We should probably remove these records from the source before recreating them in the target with the exact same reply-key and in the same partition if possible. (we have a unique index on reply-key and partition). Same partition might be unnecessary as we will fallback to scanning all partitions if not found in the specified one. Related thread in #514591 (comment 2765466886)
Edited by 🤖 GitLab Bot 🤖