Skip to content

Commit

Permalink
[CBRD_24222] Change error message for shard conf request (#69)
Browse files Browse the repository at this point in the history
log as 'deprecated' when CM requests shard.conf
  • Loading branch information
kisoo-han authored Mar 24, 2022
1 parent b7cb228 commit 3a3228b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions server/src/cm_job_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ using namespace std;
} while (0)
#endif /* !WINDOWS */

#define ER_FEATURE_DEPRECATED -2

extern T_EMGR_VERSION CLIENT_VERSION;
extern T_USER_TOKEN_INFO *user_token_info;

Expand Down Expand Up @@ -1647,6 +1649,7 @@ ts_get_all_sysparam (nvplist *req, nvplist *res, char *_dbmt_error)
FILE *infile;
char conf_path[PATH_MAX], strbuf[1024 * 200];
char *conf_name;
int ret = 0;

conf_name = nv_get_val (req, "confname");
if (conf_name == NULL)
Expand All @@ -1655,9 +1658,11 @@ ts_get_all_sysparam (nvplist *req, nvplist *res, char *_dbmt_error)
return ERR_PARAM_MISSING;
}

if (_get_confpath_by_name (conf_name, conf_path, sizeof (conf_path)) < 0)
ret = _get_confpath_by_name (conf_name, conf_path, sizeof (conf_path));
if (ret < 0)
{
strcpy (_dbmt_error, "confname error");
snprintf (_dbmt_error, DBMT_ERROR_MSG_SIZE, "(%s): %s.", conf_name,
ret == ER_FEATURE_DEPRECATED ? "deprecated" : "conf name error");
return ERR_WITH_MSG;
}

Expand Down Expand Up @@ -1713,6 +1718,10 @@ _get_confpath_by_name (const char *conf_name, char *conf_path, int buflen)
snprintf (conf_path, buflen - 1, "%s/%s", sco.szCubrid_databases,
CUBRID_DATABASE_TXT);
}
else if (uStringEqual (conf_name, "shard.conf"))
{
retval = ER_FEATURE_DEPRECATED;
}
else
{
snprintf (conf_path, buflen - 1, "%s/conf/%s", sco.szCubrid, conf_name);
Expand Down

0 comments on commit 3a3228b

Please sign in to comment.