Commit bd6a9c5
committed
(improvement) LWT no-shuffle shortcut with determinism tests
Restructure the shuffle block in TokenAwarePolicy.make_query_plan to
use a nested 'if' instead of 'and', making it explicit that LWT queries
skip both the shuffle and the list copy (Paxos leader optimization).
Includes 4 new unit tests verifying: LWT deterministic ordering, LWT
skips list copy, non-LWT shuffle works, and LWT+cache determinism.
Benchmark (100K queries, 45-node/5-DC topology, Python 3.14, median of 5 runs):
Policy | Kops/s | vs master | Mem KB
---------------------------------------------------------
DCAware | 204 | +92% | 1.5
RackAware | 180 | +165% | 2.0
TokenAware(DCAware) | 60 | +233% | 207.5
TokenAware(RackAware) | 57 | +235% | 87.1
Default(DCAware) | 132 | +45% | 1.6
HostFilter(DCAware) | 66 | +25% | 1.7
Cumulative improvement over master (all 7 commits):
DCAware: +92% (106 -> 204 Kops/s)
RackAware: +165% ( 68 -> 180 Kops/s)
TokenAware(DCAware): +233% ( 18 -> 60 Kops/s)
TokenAware(RackAware):+235% ( 17 -> 57 Kops/s)
Default(DCAware): +45% ( 91 -> 132 Kops/s)
HostFilter(DCAware): +25% ( 53 -> 66 Kops/s)
Note: TokenAware benchmark uses unique keys per query (0% cache hit
rate). Real workloads with repeated partition keys will benefit further
from the replica cache added in the previous commit. The LWT shortcut
itself has no measurable impact on non-LWT queries (which this
benchmark exercises); its benefit is deterministic ordering for LWT.1 parent 5e89ce9 commit bd6a9c5
2 files changed
Lines changed: 104 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | | - | |
775 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
776 | 777 | | |
777 | 778 | | |
778 | 779 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1445 | 1445 | | |
1446 | 1446 | | |
1447 | 1447 | | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
1448 | 1548 | | |
1449 | 1549 | | |
1450 | 1550 | | |
| |||
0 commit comments