Generate a single routing table if replication is 1#4926
Generate a single routing table if replication is 1#4926siddharthteotia wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4926 +/- ##
============================================
+ Coverage 56.54% 56.66% +0.11%
Complexity 53 53
============================================
Files 1177 1177
Lines 62894 62903 +9
Branches 9231 9233 +2
============================================
+ Hits 35566 35644 +78
+ Misses 24688 24619 -69
Partials 2640 2640
Continue to review full report at Codecov.
|
| super.init(configuration, tableConfig, propertyStore, brokerMetrics); | ||
| _numRoutingTables = configuration.getInt(NUM_ROUTING_TABLES_KEY, DEFAULT_NUM_ROUTING_TABLES); | ||
| int numReplicas = tableConfig.getValidationConfig().getReplicationNumber(); | ||
| _numRoutingTables = numReplicas == 1 ? 1 : configuration.getInt(NUM_ROUTING_TABLES_KEY, DEFAULT_NUM_ROUTING_TABLES); |
There was a problem hiding this comment.
where is this configuration coming from? My main concern about this change is if the replicationFactor changes and we invoke rebalance, the number of routingTable remains the same
There was a problem hiding this comment.
The replication is coming from tableConfig -- segmentsConfig part of tableConfig.
"segmentsConfig": {
"completionConfig": null,
"hllConfig": null,
"replicaGroupStrategyConfig": {
"numInstancesPerPartition": 2,
"partitionColumn": null
},
"replicasPerPartition": null,
"replication": "3",
"retentionTimeUnit": "DAYS",
"retentionTimeValue": "7320",
}
If the replication changes, the change should be reflected in table config right? So on the next change to external view (after changing the table config and ideal state with new servers, rebalance etc), the routing table builder should see the updated config and thus the new replication factor. Is my understanding correct?
There was a problem hiding this comment.
Just FYI.... we had seen this in couple of non prod deployments where there were 1000s of segments across 20+ servers but replication 1 and the routing table looked weird with duplicate server -> segments mapping
There was a problem hiding this comment.
If we are not guaranteed to see the updated table config after the replication factor changes then yes we should not be doing this change. AFAIK, there is no way to change the replication factor without going via table config
|
Broker nodes are not listening to table config changes. But external view has the replication factor if I am not mistaken. So my suggestion is to use that value to compute the number of routing tables. |
|
No longer apply |
If the replication is 1, we don't have to generate different versions of routing tables as all of them will be same