Implement partition database discovery via comdb2db.cfg#5254
Implement partition database discovery via comdb2db.cfg#5254chands10 merged 1 commit intobloomberg:mainfrom
Conversation
| CDB2SQLQUERY__Bindvalue__TxtArray *txt = | ||
| malloc(sizeof(CDB2SQLQUERY__Bindvalue__TxtArray)); | ||
| cdb2__sqlquery__bindvalue__txt_array__init(txt); | ||
| // txt->elements = (char **)hndl->shards; |
There was a problem hiding this comment.
Looks like cannot pass char[][] for carray binding text
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 0/0 tests failed ⚠.
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 0/0 tests failed ⚠.
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 0/0 tests failed ⚠.
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 12/615 tests failed ⚠.
The first 10 failing tests are:
disttxn [setup failure]
sc_constraints_logicalsc_generated
sc_redo_logicalsc_generated
partitiondb
remotecreate
cdb2api_unit
unionpar_maxqueue
sc_lotsoftables_logicalsc_generated
sc_lotsoftables
insert_lots_large_tran_generated
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 8/616 tests failed ⚠.
The first 10 failing tests are:
sc_timepart
analyze_fastinit_race
remotecreate
phys_rep_tiered
phys_rep_tiered_firstfile_generated
sc_downgrade
insert_lots_large_tran_generated
cldeadlock
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 8/616 tests failed ⚠.
The first 10 failing tests are:
cldeadlock
updater_latency
analyze_partial_index_off_generated
renametable
sc_downgrade
insert_lots_large_tran_generated
selectv_rcode_disable_svonly_nop_generated
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Error. ⚠.
Smoke testing: Success ✓.
Cbuild submission: Success ✓.
Regression testing: 6/616 tests failed ⚠.
The first 10 failing tests are:
phys_rep_tiered_firstfile_generated
queuedb_rollover
unionpar_maxqueue
sc_lotsoftables_logicalsc_generated
sc_lotsoftables
cldeadlock
cdb2api/cdb2api.c
Outdated
| tok = strtok_r(NULL, " :,", &last); | ||
| (*num_db_hosts)++; | ||
| } | ||
| } else if (num_shards && strcasecmp("shard", tok) == 0) { |
There was a problem hiding this comment.
The config line details the db names part of a partition, one db name per shard. Lets call it "partition" instead of "shard"/"shards"
There was a problem hiding this comment.
Do you want me to name the variable as partition as well instead of shards?
There was a problem hiding this comment.
Changed comdb2db.cfg to be partition instead of shard
cdb2api/cdb2api.c
Outdated
| debugprint("cdb2_get_dbhosts returns %d\n", rc); | ||
| if (rc == 0 && hndl->num_shards > 0) { | ||
| char db_shard[DBNAME_LEN]; | ||
| int shard_num = (hndl->num_shards_sameroom > 0 && (hndl->flags & CDB2_RANDOMROOM)) ? rand() % hndl->num_shards_sameroom : rand() % hndl->num_shards; |
There was a problem hiding this comment.
what happens if the client uses CDB2_ROOM instead of CDB2_RANDOMROOM? do I get a node from same room?
|
Do you mind adding some comments for the code, it would be much clearer for the future what some more tricky pieces of code are doing? |
1b21f8f to
2e935b1
Compare
|
Added some comments to my code! Lmk if there's something confusing where I didn't comment |
Signed-off-by: Salil Chandra <schandra107@bloomberg.net>
dorinhogea
left a comment
There was a problem hiding this comment.
Thank you, looks good to me
roborivers
left a comment
There was a problem hiding this comment.
Coding style check: Success ✓.
Smoke testing: Error ⚠.
Cbuild submission: Success ✓.
Regression testing: 1/627 tests failed ⚠.
The first 10 failing tests are:
logfill_logput_window_generated
|
Thanks Dorin!! |
Am taking suggestions for different name to specify sharding in comdb2db.cfg as opposed to just
shardNote: in testsuite will get logmsg
get_host_by_name:gethostbyname(%s): errno=0 err=Successbecause cannot query comdb2db. Code will continue to open shard