Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-4407

add support for cockroachdb as zabbix backend database

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Server (S)
    • None

      cockroachDB is a very nice database, built for cloud usage, from the ground up. The database is built with postgres client compatibility in mind but it wil never get the full 100%.

      For that reason it would be nice to add support for it in a way that the minor differences with postgres can be handled.

      One thing would be to use select version(); to detect the correct database:
      CockroachDB CCL v2.0-alpha.20180212 (darwin amd64, built 2018/02/12 17:56:22, go1.9.3)
      or
      PostgreSQL 9.6.5 on x86_64-apple-darwin14.5.0, compiled by Apple LLVM version 7.0.0 (clang-700.1.76), 64-bit

      currently set schema is not supported. If zabbix defaults to checking for tables using the username instead of public, the tests succeed.
      src/zbxdbhigh/db.c could be changed
      (
      #elif defined(HAVE_POSTGRESQL)
      2049 table_schema_esc = DBdyn_escape_string(NULL == CONFIG_DBSCHEMA || '\0' == *CONFIG_DBSCHEMA ?
      2050 "public" : CONFIG_DBSCHEMA);
      )
      set schema in cockroachdb will be supported in v2, to be launched in April.

      During the logon a few settings are not needed:
      and in src/zbxdb/db.c
      (
      /* disable "nonstandard use of \' in a string literal" warning */
      555 if (0 < (ret = zbx_db_execute("%s", "set escape_string_warning to off")))
      556 ret = ZBX_DB_OK;
      )
      and
      if (90000 <= ZBX_PG_SVERSION)
      574

      { 575 /* change the output format for values of type bytea from hex (the default) to escape */ 576 if (0 < (ret = zbx_db_execute("%s", "set bytea_output=escape"))) 577 ret = ZBX_DB_OK; 578 }

      should be ignored.

      This database requires all foreign keys to be indexed. That would not hurt other databases too.
      Currently I have zabbix-3.0.14 running on CRDB-v2 alpha release.

            wiper Andris Zeila
            ik_zelf Ronald Rood
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: