add dup key don't output fatal log
This commit is contained in:
@@ -258,8 +258,11 @@ bool_plugin_runtime_update_row(struct bool_plugin_runtime *bool_plugin_rt,
|
||||
struct ex_container *ex_container = ex_container_new(ex_data, (void *)expr);
|
||||
ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len, ex_container);
|
||||
if (ret < 0) {
|
||||
log_debug(bool_plugin_rt->logger, MODULE_BOOL_PLUGIN,
|
||||
"[%s:%d]bool_plugin table:<%s> add key failed, "
|
||||
"key:%s", __FUNCTION__, __LINE__, table_name, key);
|
||||
ex_container_free(ex_data_rt, ex_container);
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ static int expr_runtime_update_row(struct expr_runtime *expr_rt, char *key,
|
||||
//add
|
||||
ret = rcu_hash_add(expr_rt->item_hash, key, key_len, (void *)item);
|
||||
if (ret < 0) {
|
||||
log_fatal(expr_rt->logger, MODULE_EXPR,
|
||||
log_debug(expr_rt->logger, MODULE_EXPR,
|
||||
"[%s:%d] expr item(item_id:%lld) add to item_hash failed",
|
||||
__FUNCTION__, __LINE__, item->item_id);
|
||||
return -1;
|
||||
@@ -859,8 +859,7 @@ int expr_runtime_update(void *expr_runtime, void *expr_schema,
|
||||
if (expr_item != NULL) {
|
||||
expr_item_free(expr_item);
|
||||
}
|
||||
expr_rt->update_err_cnt++;
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -264,7 +264,7 @@ static int flag_runtime_update_row(struct flag_runtime *flag_rt, char *key,
|
||||
//add
|
||||
ret = rcu_hash_add(flag_rt->item_hash, key, key_len, (void *)item);
|
||||
if (ret < 0) {
|
||||
log_fatal(flag_rt->logger, MODULE_FLAG,
|
||||
log_debug(flag_rt->logger, MODULE_FLAG,
|
||||
"[%s:%d] flag item(item_id:%lld) add to item_hash failed",
|
||||
__FUNCTION__, __LINE__, item->item_id);
|
||||
return -1;
|
||||
@@ -449,8 +449,7 @@ int flag_runtime_update(void *flag_runtime, void *flag_schema,
|
||||
if (flag_item != NULL) {
|
||||
flag_item_free(flag_item);
|
||||
}
|
||||
flag_rt->update_err_cnt++;
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -380,8 +380,11 @@ fqdn_plugin_runtime_update_row(struct fqdn_plugin_runtime *fqdn_plugin_rt,
|
||||
ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len,
|
||||
ex_container);
|
||||
if (ret < 0) {
|
||||
log_debug(fqdn_plugin_rt->logger, MODULE_FQDN_PLUGIN,
|
||||
"[%s:%d]fqdn_plugin table:<%s> add key failed, "
|
||||
"key:%s", __FUNCTION__, __LINE__, table_name, key);
|
||||
ex_container_free(ex_data_rt, ex_container);
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ static int interval_runtime_update_row(struct interval_runtime *interval_rt,
|
||||
//add
|
||||
ret = rcu_hash_add(interval_rt->item_hash, key, key_len, (void *)item);
|
||||
if (ret < 0) {
|
||||
log_fatal(interval_rt->logger, MODULE_INTERVAL,
|
||||
log_debug(interval_rt->logger, MODULE_INTERVAL,
|
||||
"[%s:%d] interval item(item_id:%lld) add to "
|
||||
"interavl_item_hash failed", __FUNCTION__, __LINE__,
|
||||
item->item_id);
|
||||
@@ -448,8 +448,7 @@ int interval_runtime_update(void *interval_runtime, void *interval_schema,
|
||||
if (interval_item != NULL) {
|
||||
interval_item_free(interval_item);
|
||||
}
|
||||
interval_rt->update_err_cnt++;
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -423,7 +423,7 @@ static int ip_runtime_update_row(struct ip_runtime *ip_rt, char *key, size_t key
|
||||
// add
|
||||
ret = rcu_hash_add(ip_rt->item_hash, key, key_len, (void *)item);
|
||||
if (ret < 0) {
|
||||
log_fatal(ip_rt->logger, MODULE_IP,
|
||||
log_debug(ip_rt->logger, MODULE_IP,
|
||||
"[%s:%d] ip item(item_id:%lld) add to ip runtime htable failed",
|
||||
__FUNCTION__, __LINE__, item->item_id);
|
||||
return -1;
|
||||
@@ -480,8 +480,7 @@ int ip_runtime_update(void *ip_runtime, void *ip_schema,
|
||||
if (ip_item != NULL) {
|
||||
ip_item_free(ip_item);
|
||||
}
|
||||
ip_rt->update_err_cnt++;
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -385,8 +385,11 @@ ip_plugin_runtime_update_row(struct ip_plugin_runtime *ip_plugin_rt,
|
||||
ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len,
|
||||
ex_container);
|
||||
if (ret < 0) {
|
||||
log_debug(ip_plugin_rt->logger, MODULE_IP_PLUGIN,
|
||||
"[%s:%d]ip_plugin table:<%s> add key failed, "
|
||||
"key:%s", __FUNCTION__, __LINE__, table_name, key);
|
||||
ex_container_free(ex_data_rt, ex_container);
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -401,8 +401,11 @@ ipport_plugin_runtime_update_row(struct ipport_plugin_runtime *ipport_plugin_rt,
|
||||
ret = ex_data_runtime_add_ex_container(ex_data_rt, key, key_len,
|
||||
ex_container);
|
||||
if (ret < 0) {
|
||||
log_debug(ipport_plugin_rt->logger, MODULE_IPPORT_PLUGIN,
|
||||
"[%s:%d]ipport_plugin table:<%s> add key failed, "
|
||||
"key:%s", __FUNCTION__, __LINE__, table_name, key);
|
||||
ex_container_free(ex_data_rt, ex_container);
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -368,8 +368,12 @@ static int plugin_runtime_update_row(struct plugin_runtime *plugin_rt,
|
||||
ret = ex_data_runtime_add_ex_container(plugin_rt->ex_data_rt, key, key_len,
|
||||
ex_container);
|
||||
if (ret < 0) {
|
||||
log_debug(plugin_rt->logger, MODULE_PLUGIN,
|
||||
"[%s:%d]plugin table:<%s> add key failed, "
|
||||
"key:%s", __FUNCTION__, __LINE__, table_name, key);
|
||||
ex_container_free(plugin_rt->ex_data_rt, ex_container);
|
||||
return -1;
|
||||
//don't return failed, ignore the case of adding duplicate keys
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user