Skip to content

Conversation

blagoev
Copy link
Collaborator

@blagoev blagoev commented Oct 7, 2025

This integrates sharded mongodb driver support changes.

For non sharded code here is a patch run

For sharded changes I have manually verified that sharded data is distributed correctly and test are able to run with a 5sec test.

MongoDB Enterprise mongos> db.getSiblingDB("tpcc").ORDERS.getShardDistribution()

Shard rs0 at rs0/10.2.1.119:27018,10.2.1.238:27018,10.2.5.14:27018
 data : 319.22MiB docs : 213490 chunks : 1
 estimated data per chunk : 319.22MiB
 estimated docs per chunk : 213490

Shard rs1 at rs1/10.2.2.225:27018,10.2.5.11:27018,10.2.5.211:27018
 data : 319.59MiB docs : 213557 chunks : 1
 estimated data per chunk : 319.59MiB
 estimated docs per chunk : 213557

Shard config at config/10.2.4.227:27018,10.2.5.181:27018,10.2.7.88:27018
 data : 319.02MiB docs : 213635 chunks : 1
 estimated data per chunk : 319.02MiB
 estimated docs per chunk : 213635

Totals
 data : 957.84MiB docs : 640682 chunks : 3
 Shard rs0 contains 33.32% data, 33.32% docs in cluster, avg obj size on shard : 1KiB
 Shard rs1 contains 33.36% data, 33.33% docs in cluster, avg obj size on shard : 1KiB
 Shard config contains 33.3% data, 33.34% docs in cluster, avg obj size on shard : 1KiB
2025-10-09 10:19:14,939 [<module>:352] INFO : Final Results
2025-10-09 10:19:14,939 [<module>:353] INFO : Threads: 100
{'PAYMENT': 2791, 'NEW_ORDER': 2793, 'DELIVERY': 256, 'STOCK_LEVEL': 266, 'ORDER_STATUS': 249}
{'DELIVERY': {'latency': {'min': 33.447980880737305, 'max': 677.8640747070312, 'p50': 91.43757820129395, 'p75': 119.52018737792969, 'p90': 185.97674369812012, 'p95': 362.3852729797363, 'p99': 396.35324478149414}, 'total': 256, 'retries': {'retries_ops': {'1': 37, '0': 206, '2': 11, '3': 2}, 'retries_txn_total': 65, 'retries_total_ops': 50}}, 'NEW_ORDER': {'latency': {'min': 10.83683967590332, 'max': 1049.6234893798828, 'p50': 27.6339054107666, 'p75': 35.21728515625, 'p90': 120.33653259277344, 'p95': 130.72776794433594, 'p99': 333.0719470977783}, 'total': 2793, 'retries': {'retries_ops': {'0': 2553, '1': 227, '2': 36, '4': 1, '3': 3}, 'retries_txn_total': 377, 'retries_total_ops': 267}}, 'ORDER_STATUS': {'latency': {'min': 6.7577362060546875, 'max': 119.46320533752441, 'p50': 13.758182525634766, 'p75': 16.608476638793945, 'p90': 21.6066837310791, 'p95': 25.705337524414062, 'p99': 79.45466041564941}, 'total': 249}, 'PAYMENT': {'latency': {'min': 6.632566452026367, 'max': 2921.9937324523926, 'p50': 22.613048553466797, 'p75': 124.43685531616211, 'p90': 333.2977294921875, 'p95': 637.9497051239014, 'p99': 1057.8768253326416}, 'total': 2791, 'retries': {'retries_ops': {'1': 613, '0': 1760, '2': 235, '4': 44, '3': 120, '6': 4, '5': 12, '7': 3}, 'retries_txn_total': 2101, 'retries_total_ops': 1031}}, 'STOCK_LEVEL': {'latency': {'min': 5.744218826293945, 'max': 51.169633865356445, 'p50': 10.51473617553711, 'p75': 12.638330459594727, 'p90': 15.496492385864258, 'p95': 17.209529876708984, 'p99': 36.26656532287598}, 'total': 266}, 'tpmc': 33241.40657279722, 'denorm': True, 'duration': 5.041302919387817, 'warehouses': 21, 'date': '2025-10-09 10:19:14', 'threads': 100, 'txn': True, 'batch_writes': True, 'find_and_modify': True, 'read_preference': 'nearest', 'write_concern': '1', 'causal': True, 'no_global_items': False, 'all_in_one_txn': True, 'retry_writes': True, 'read_concern': 'majority', 'shards': 3, 'total_retries': 2101, 'samewh': 85, 'total': 6355, 'aborts': 27, 'instance': None}
2025-10-09 10:19:14,981 [<module>:354] INFO :
========================================================================================================================================================================================================
Execution Results after 5 seconds
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                  Complete        Time (µs)       Percentage      Retries         minLatMs        p50             p75             p90             p95             p99             maxLatMs        Aborts
  DELIVERY        256                30.739        4.03           50,65           33.45            91.44          119.52          185.98          362.39          396.35          677.86          0
  NEW_ORDER       2793              120.726       43.95           267,312         10.84            27.63           35.22          120.34          130.73          333.07          1049.62         27
  ORDER_STATUS    249                 3.906        3.92           0,0              6.76            13.76           16.61           21.61           25.71           79.45          119.46          0
  PAYMENT         2791              351.607       43.92           1031,1724        6.63            22.61          124.44          333.30          637.95          1057.88         2921.99         0
  STOCK_LEVEL     266                 3.066        4.19           0,0              5.74            10.51           12.64           15.50           17.21           36.27           51.17          0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  TOTAL           6355                 510.044
2025-10-09 10:19:14 TpmC for denorm 100 thr with txn 21 WH: 33241 2793 total 5 durSec, batch on 2101 retries 33.06% with fnM nearest p50  27.63 p75  35.22 p90 120.34 p95 130.73 p99 333.07 max 1049.62 WC WriteConcern(w=1) causal true 10in1 true retry true 6355 27 correct 85 noGlobalItems false

@miguelangelnieto
Copy link
Collaborator

Please, share a patch test that shows it working on sharding and regular replica set.

@blagoev
Copy link
Collaborator Author

blagoev commented Oct 10, 2025

@miguelangelnieto I have updated the PR description with your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants