Skip to content

Commit 778a784

Browse files
committed
Sharding reference
1 parent 1f7a33a commit 778a784

File tree

1 file changed

+261
-0
lines changed

1 file changed

+261
-0
lines changed

doc/reference/configuration/configuration_reference.rst

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,3 +2389,264 @@ The ``security`` section defines configuration parameters related to various sec
23892389
| Type: boolean
23902390
| Default: false
23912391
| Environment variable: TT_SECURITY_SECURE_ERASING
2392+
2393+
2394+
2395+
2396+
.. _configuration_reference_sharding:
2397+
2398+
sharding
2399+
--------
2400+
2401+
The ``sharding`` section defines configuration parameters related to sharding using :ref:`vshard <vshard>`.
2402+
2403+
- :ref:`sharding.bucket_count <configuration_reference_sharding_bucket_count>`
2404+
- :ref:`sharding.connection_outdate_delay <configuration_reference_sharding_connection_outdate_delay>`
2405+
- :ref:`sharding.discovery_mode <configuration_reference_sharding_discovery_mode>`
2406+
- :ref:`sharding.failover_ping_timeout <configuration_reference_sharding_failover_ping_timeout>`
2407+
- :ref:`sharding.lock <configuration_reference_sharding_lock>`
2408+
- :ref:`sharding.rebalancer_disbalance_threshold <configuration_reference_sharding_rebalancer_disbalance_threshold>`
2409+
- :ref:`sharding.rebalancer_max_receiving <configuration_reference_sharding_rebalancer_max_receiving>`
2410+
- :ref:`sharding.rebalancer_max_sending <configuration_reference_sharding_rebalancer_max_sending>`
2411+
- :ref:`sharding.rebalancer_mode <configuration_reference_sharding_rebalancer_mode>`
2412+
- :ref:`sharding.roles <configuration_reference_sharding_roles>`
2413+
- :ref:`sharding.sched_move_quota <configuration_reference_sharding_sched_move_quota>`
2414+
- :ref:`sharding.sched_ref_quota <configuration_reference_sharding_sched_ref_quota>`
2415+
- :ref:`sharding.shard_index <configuration_reference_sharding_shard_index>`
2416+
- :ref:`sharding.sync_timeout <configuration_reference_sharding_sync_timeout>`
2417+
- :ref:`sharding.zone <configuration_reference_sharding_zone>`
2418+
2419+
2420+
2421+
.. _configuration_reference_sharding_bucket_count:
2422+
2423+
.. confval:: sharding.bucket_count
2424+
2425+
The total number of buckets in a cluster.
2426+
2427+
This number should be several orders of magnitude larger than the potential number
2428+
of cluster nodes, considering potential scaling out in the foreseeable future.
2429+
2430+
**Example:**
2431+
2432+
If the estimated number of nodes is M, then the data set should be divided into
2433+
100M or even 1000M buckets, depending on the planned scaling out. This number is
2434+
greater than the potential number of cluster nodes in the system being designed.
2435+
2436+
Keep in mind that too many buckets can cause a need to allocate more memory to store
2437+
routing information. On the other hand, an insufficient number of buckets can lead to
2438+
decreased granularity when rebalancing.
2439+
2440+
|
2441+
| Type: integer
2442+
| Default: 3000
2443+
| Environment variable: TT_SHARDING_BUCKET_COUNT
2444+
2445+
2446+
.. _configuration_reference_sharding_connection_outdate_delay:
2447+
2448+
.. confval:: sharding.connection_outdate_delay
2449+
2450+
[TODO] Router: Time to outdate old objects on reload.
2451+
2452+
|
2453+
| Type: number
2454+
| Default: nil
2455+
| Environment variable: TT_SHARDING_CONNECTION_OUTDATE_DELAY
2456+
2457+
2458+
.. _configuration_reference_sharding_discovery_mode:
2459+
2460+
.. confval:: sharding.discovery_mode
2461+
2462+
A mode of a bucket discovery fiber.
2463+
See details in :ref:`router_api-discovery_set`.
2464+
2465+
|
2466+
| Type: string
2467+
| Default: 'on'
2468+
| Possible values: 'on', 'off', 'once'
2469+
| Environment variable: TT_SHARDING_DISCOVERY_MODE
2470+
2471+
2472+
.. _configuration_reference_sharding_failover_ping_timeout:
2473+
2474+
.. confval:: sharding.failover_ping_timeout
2475+
2476+
[TODO] Timeout after which a ping is considered to be unacknowledged.
2477+
Used by failover fiber to detect if a node is down.
2478+
2479+
|
2480+
| Type: number
2481+
| Default: 5
2482+
| Environment variable: TT_SHARDING_FAILOVER_PING_TIMEOUT
2483+
2484+
2485+
.. _configuration_reference_sharding_lock:
2486+
2487+
.. confval:: sharding.lock
2488+
2489+
[TODO] Flag whether the replicaset is locked.
2490+
If set to true, the replicaset won't send nor receive any buckets.
2491+
Rebalancer will simply ignore it.
2492+
To work this option must be set at least on the affected replicaset itself in its vshard.storage.cfg.
2493+
Default is false.
2494+
2495+
|
2496+
| Type: boolean
2497+
| Default: nil
2498+
| Environment variable: TT_SHARDING_LOCK
2499+
2500+
2501+
.. _configuration_reference_sharding_rebalancer_disbalance_threshold:
2502+
2503+
.. confval:: sharding.rebalancer_disbalance_threshold
2504+
2505+
The maximum bucket disbalance threshold (in percent).
2506+
The disbalance is calculated for each replica set using the following formula:
2507+
2508+
.. code-block:: none
2509+
2510+
|etalon_bucket_count - real_bucket_count| / etalon_bucket_count * 100
2511+
2512+
|
2513+
| Type: number
2514+
| Default: 1
2515+
| Environment variable: TT_SHARDING_REBALANCER_DISBALANCE_THRESHOLD
2516+
2517+
2518+
.. _configuration_reference_sharding_rebalancer_max_receiving:
2519+
2520+
.. confval:: sharding.rebalancer_max_receiving
2521+
2522+
The maximum number of buckets that can be received in parallel by a single
2523+
replica set. This number must be limited, because when a new replica set is added to
2524+
a cluster, the rebalancer sends a very large amount of buckets from the existing
2525+
replica sets to the new one. This produces a heavy load on the new replica set.
2526+
2527+
**Example:**
2528+
2529+
Suppose ``rebalancer_max_receiving`` is equal to 100, ``bucket_count`` is equal to 1000.
2530+
There are 3 replica sets with 333, 333 and 334 buckets on each respectively.
2531+
When a new replica set is added, each replica set’s ``etalon_bucket_count`` becomes
2532+
equal to 250. Rather than receiving all 250 buckets at once, the new replica set
2533+
receives 100, 100 and 50 buckets sequentially.
2534+
2535+
|
2536+
| Type: integer
2537+
| Default: 100
2538+
| Environment variable: TT_SHARDING_REBALANCER_MAX_RECEIVING
2539+
2540+
2541+
.. _configuration_reference_sharding_rebalancer_max_sending:
2542+
2543+
.. confval:: sharding.rebalancer_max_sending
2544+
2545+
The degree of parallelism for :ref:`parallel rebalancing <vshard-parallel-rebalancing>`.
2546+
2547+
Works for storages only, ignored for routers.
2548+
2549+
|
2550+
| Type: integer
2551+
| Default: 1
2552+
| Maximum: 15
2553+
| Environment variable: TT_SHARDING_REBALANCER_MAX_SENDING
2554+
2555+
2556+
.. _configuration_reference_sharding_rebalancer_mode:
2557+
2558+
.. confval:: sharding.rebalancer_mode
2559+
2560+
[TODO] A rebalancer mode:
2561+
2562+
* ``manual``
2563+
* ``auto``
2564+
* ``off``
2565+
2566+
|
2567+
| Type: string
2568+
| Default: 'auto'
2569+
| Environment variable: TT_SHARDING_REBALANCER_MODE
2570+
2571+
2572+
.. _configuration_reference_sharding_roles:
2573+
2574+
.. confval:: sharding.roles
2575+
2576+
[TODO] A sharding role:
2577+
2578+
* ``router``
2579+
* ``storage``
2580+
* ``rebalancer``
2581+
2582+
|
2583+
| Type: array
2584+
| Default: nil
2585+
| Environment variable: TT_SHARDING_ROLES
2586+
2587+
2588+
.. _configuration_reference_sharding_sched_move_quota:
2589+
2590+
.. confval:: sharding.sched_move_quota
2591+
2592+
[TODO] Scheduler bucket move quota.
2593+
2594+
|
2595+
| Type: number
2596+
| Default: 1
2597+
| Environment variable: TT_SHARDING_SCHED_MOVE_QUOTA
2598+
2599+
2600+
.. _configuration_reference_sharding_sched_ref_quota:
2601+
2602+
.. confval:: sharding.sched_ref_quota
2603+
2604+
[TODO] Scheduler storage ref quota.
2605+
2606+
The scheduler shares storage time between bucket moves and storage refs fairly. The distribution depends on how long and frequent the moves and refs are. It can be configured using the storage options ``sched_move_quota`` and ``sched_ref_quota``. Keep in mind that the scheduler configuration may affect map-reduce requests if used during rebalancing.
2607+
2608+
|
2609+
| Type: number
2610+
| Default: 300
2611+
| Environment variable: TT_SHARDING_SCHED_REF_QUOTA
2612+
2613+
2614+
.. _configuration_reference_sharding_shard_index:
2615+
2616+
.. confval:: sharding.shard_index
2617+
2618+
The name or ID of a TREE index over the :ref:`bucket id <vshard-vbuckets>`.
2619+
Spaces without this index do not participate in a sharded Tarantool
2620+
cluster and can be used as regular spaces if needed. It is necessary to
2621+
specify the first part of the index, other parts are optional.
2622+
2623+
|
2624+
| Type: string
2625+
| Default: 'bucket_id'
2626+
| Environment variable: TT_SHARDING_SHARD_INDEX
2627+
2628+
2629+
.. _configuration_reference_sharding_sync_timeout:
2630+
2631+
.. confval:: sharding.sync_timeout
2632+
2633+
The timeout to wait for synchronization of the old master with replicas before demotion.
2634+
Used when switching a master or when manually calling the :ref:`sync() <storage_api-sync>` function.
2635+
2636+
|
2637+
| Type: number
2638+
| Default: 1
2639+
| Environment variable: TT_SHARDING_SYNC_TIMEOUT
2640+
2641+
2642+
.. _configuration_reference_sharding_zone:
2643+
2644+
.. confval:: sharding.zone
2645+
2646+
[TODO] Replica zone (see weighted routing in the section 'Replicas weight configuration');
2647+
Zone where the replica is located. String or number. See weights root config option for more info about what zones do. Default is nil. If a replica has no zone, in the weights matrix it gets the worst score.
2648+
2649+
|
2650+
| Type: integer
2651+
| Default: nil
2652+
| Environment variable: TT_SHARDING_ZONE

0 commit comments

Comments
 (0)