Commit fc86f4c
committed
router: forbid using cdata as bucket_id
Using cdata (e.g. 1ULL) as bucket id was allowed in all requests of the
router. But using it caused the growth of the `route_map` table on every
request and full scan of the cluster in order to find, where the bucket
is. This happened due to the fact, that cdata is compared by its pointer,
not the value, and consequently, as there was no such pointer key in the
`route_map`, it was added and scanned every time.
It was decided to prohibit such usage, from now on we expect users to do
`tonumber(bucket_id)`, if it's needed. The motivation for such solution
is the fact, that all functions except calls already prohibit using
cdata as bucket_id, and calls should be consistent with it. Another
point is the fact, that the behavior of the `map_callrw` with cdata as
bucket ids is very untrivial.
The alternative solution of allowing usage of cdata in calls and manually
converting values to number in `bucket_set`, `bucket_reset` and
`bucket_resolved` was rejected due to the above mentioned reasons.
Unfortunately, the behavior of `map_callrw` with array of cdata is still
untrivial, as {10ULL, 20ULL} is interpreted as {1 = 10, 2 = 20}, and the
request is executed on the replicaset with 1st and 2nd bucket.
Closes #594
NO_DOC=bugfix1 parent f72bb21 commit fc86f4c
File tree
3 files changed
+85
-2
lines changed- test/router-luatest
- vshard/router
3 files changed
+85
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
| |||
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
| |||
1140 | 1147 | | |
1141 | 1148 | | |
1142 | 1149 | | |
1143 | | - | |
1144 | | - | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1145 | 1154 | | |
1146 | 1155 | | |
1147 | 1156 | | |
| |||
0 commit comments