Commit af9a222
committed
kvcoord: treat non-transactional writes as non-idempotent
Previously, non-transactional requests were treated as idempotent by the
`DistSender`, meaning they were retried in the presence of RPC errors.
This could lead to double-evaluating these requests, including writes.
This can result in, for example, an increment applying twice, or more
subtle problems like a blind write evaluating twice, overwriting
another unrelated write that fell in-between. This issue is known and
documented in the `DistSender` code. It is not a production correctness
issue since SQL always uses the transactional KV API.
This commit treats non-transactional write batches the same way as
transactional batches that contain a commit: if they experience an RPC
error, they should not be retried, and should return an ambiguous
error. The new logic is currently behind an off-by-default cluster
setting as it will require deflaking many tests. The plan is to enable
this in some kvnemesis tests first.
Informs: #154389
Informs: #114814
Release note: None1 parent e5f821c commit af9a222
File tree
2 files changed
+114
-37
lines changed- pkg/kv/kvclient/kvcoord
2 files changed
+114
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
422 | 436 | | |
423 | 437 | | |
424 | 438 | | |
| |||
2541 | 2555 | | |
2542 | 2556 | | |
2543 | 2557 | | |
2544 | | - | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
2545 | 2565 | | |
2546 | 2566 | | |
2547 | 2567 | | |
| |||
2759 | 2779 | | |
2760 | 2780 | | |
2761 | 2781 | | |
2762 | | - | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
2763 | 2785 | | |
2764 | 2786 | | |
2765 | 2787 | | |
| |||
2861 | 2883 | | |
2862 | 2884 | | |
2863 | 2885 | | |
2864 | | - | |
| 2886 | + | |
| 2887 | + | |
2865 | 2888 | | |
2866 | | - | |
2867 | | - | |
2868 | | - | |
2869 | | - | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
2870 | 2892 | | |
2871 | 2893 | | |
2872 | 2894 | | |
| |||
2987 | 3009 | | |
2988 | 3010 | | |
2989 | 3011 | | |
2990 | | - | |
2991 | | - | |
2992 | | - | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
2993 | 3015 | | |
2994 | 3016 | | |
2995 | 3017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3664 | 3664 | | |
3665 | 3665 | | |
3666 | 3666 | | |
| 3667 | + | |
3667 | 3668 | | |
3668 | 3669 | | |
3669 | 3670 | | |
| |||
3675 | 3676 | | |
3676 | 3677 | | |
3677 | 3678 | | |
| 3679 | + | |
3678 | 3680 | | |
3679 | 3681 | | |
3680 | 3682 | | |
3681 | 3683 | | |
3682 | 3684 | | |
3683 | 3685 | | |
3684 | 3686 | | |
3685 | | - | |
3686 | | - | |
3687 | | - | |
3688 | | - | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
3689 | 3692 | | |
3690 | 3693 | | |
3691 | 3694 | | |
3692 | | - | |
3693 | | - | |
3694 | | - | |
3695 | | - | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
3696 | 3700 | | |
3697 | 3701 | | |
3698 | 3702 | | |
3699 | | - | |
3700 | | - | |
3701 | | - | |
3702 | | - | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
3703 | 3708 | | |
3704 | 3709 | | |
3705 | 3710 | | |
3706 | | - | |
3707 | | - | |
3708 | | - | |
3709 | | - | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
3710 | 3728 | | |
3711 | | - | |
3712 | 3729 | | |
3713 | | - | |
3714 | | - | |
3715 | | - | |
3716 | | - | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
3717 | 3760 | | |
3718 | | - | |
3719 | 3761 | | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
3724 | 3774 | | |
3725 | 3775 | | |
3726 | 3776 | | |
| |||
3744 | 3794 | | |
3745 | 3795 | | |
3746 | 3796 | | |
| 3797 | + | |
3747 | 3798 | | |
3748 | 3799 | | |
3749 | 3800 | | |
| |||
3786 | 3837 | | |
3787 | 3838 | | |
3788 | 3839 | | |
3789 | | - | |
| 3840 | + | |
3790 | 3841 | | |
3791 | 3842 | | |
3792 | 3843 | | |
3793 | 3844 | | |
3794 | 3845 | | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
3795 | 3850 | | |
3796 | 3851 | | |
3797 | 3852 | | |
| |||
0 commit comments