Skip to content

Commit

Permalink
Merge "Send DNS records to named in batches instead of bulk send." in…
Browse files Browse the repository at this point in the history
…to R3.0.2.x
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 8, 2016
2 parents d458e3f + 9ff8b81 commit 9335fc4
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 52 deletions.
15 changes: 15 additions & 0 deletions src/dns/cmn/dns.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ response sandesh AgentXmppDnsDataResponse {
1: list<AgentDnsData> data;
}

struct PendingListEntry {
1: i32 xid;
2: string view;
3: string zone;
4: i32 retry_count;
5: string items;
}

request sandesh ShowBindPendingList {
}

response sandesh BindPendingListResponse {
1: list<PendingListEntry> data;
}

systemlog sandesh DnsConfiguration {
1: string message;
2: string config_name;
Expand Down
12 changes: 11 additions & 1 deletion src/dns/cmn/dns_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ void Options::Initialize(EventManager &evm,
opt::value<string>()->default_value("xvysmOR8lnUQRBcunkC6vg=="),
"RNDC secret")
("DEFAULT.named_max_cache_size",
opt::value<string>()->default_value("100M"),
opt::value<string>()->default_value("32M"),
"Maximum cache size, in bytes, used by contrail-named (per view)")
("DEFAULT.named_max_retransmissions",
opt::value<uint16_t>()->default_value(12),
"Maximum number of retries to named")
("DEFAULT.named_retransmission_interval",
opt::value<uint16_t>()->default_value(1000),
"Retranmission interval in msec")

("DEFAULT.hostip", opt::value<string>()->default_value(host_ip),
"IP address of DNS Server")
Expand Down Expand Up @@ -262,6 +268,10 @@ void Options::Process(int argc, char *argv[],
GetOptValue<string>(var_map, rndc_secret_, "DEFAULT.rndc_secret");
GetOptValue<string>(var_map, named_max_cache_size_,
"DEFAULT.named_max_cache_size");
GetOptValue<uint16_t>(var_map, named_max_retransmissions_,
"DEFAULT.named_max_retransmissions");
GetOptValue<uint16_t>(var_map, named_retransmission_interval_,
"DEFAULT.named_retransmission_interval");

GetOptValue<string>(var_map, host_ip_, "DEFAULT.hostip");
GetOptValue<string>(var_map, hostname_, "DEFAULT.hostname");
Expand Down
6 changes: 6 additions & 0 deletions src/dns/cmn/dns_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class Options {
const std::string & named_max_cache_size() const {
return named_max_cache_size_;
}
const uint16_t named_max_retransmissions() { return named_max_retransmissions_; }
const uint16_t named_retransmission_interval() {
return named_retransmission_interval_;
}
std::string hostname() const { return hostname_; }
std::string host_ip() const { return host_ip_; }
uint16_t http_server_port() const { return http_server_port_; }
Expand Down Expand Up @@ -101,6 +105,8 @@ class Options {
std::string rndc_config_file_;
std::string rndc_secret_;
std::string named_max_cache_size_;
uint16_t named_max_retransmissions_;
uint16_t named_retransmission_interval_;

std::string hostname_;
std::string host_ip_;
Expand Down
8 changes: 5 additions & 3 deletions src/dns/contrail-dns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ named_config_directory=/etc/contrail/dns # named config directory
named_log_file=/var/log/contrail/contrail-named.log # named log file
rndc_config_file=contrail-rndc.conf # rndc config file
rndc_secret=secret==$ # rndc secret
named_max_cache_size=25K # max-cache-size (bytes) per view, can be in K or M
# hostip= # Resolved IP of `hostname`
# hostname= # Retrieved as `hostname`
named_max_cache_size=32M # max-cache-size (bytes) per view, can be in K or M
named_max_retransmissions=12
named_retransmission_interval=1000 # msec
# hostip= # Resolved first IP from `hostname --ip-address` output
# hostname= # Retrieved from gethostname() or `hostname -s` equivalent
# http_server_port=8092
# dns_server_port=53
# log_category=
Expand Down
5 changes: 4 additions & 1 deletion src/dns/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ int main(int argc, char *argv[]) {
options.named_log_file(),
options.rndc_config_file(),
options.rndc_secret(),
options.named_max_cache_size());
options.named_max_cache_size(),
options.named_max_retransmissions(),
options.named_retransmission_interval());
DnsConfigParser parser(&config_db);
parser.Parse(FileRead(options.config_file()));

Expand Down Expand Up @@ -292,6 +294,7 @@ int main(int argc, char *argv[]) {
&config_db, _1, _2, _3),
Dns::GetEventManager()->io_service());
ifmap_server.set_ifmap_manager(ifmapmgr);
dns_manager.set_ifmap_manager(ifmapmgr);
ifmapmgr->InitializeDiscovery(ds_client, options.ifmap_server_url());

Dns::GetEventManager()->Run();
Expand Down

0 comments on commit 9335fc4

Please sign in to comment.