3.00.6

涉及保持一致性或兼容行业惯例的修改

  • 支持 ANY 类型和列式元组(columnar tuple)的细分类型表达。涉及 typestrtypeschema 等函数的输出变化:

    • 使用 ANY[<BasicType>] 表示 ANY 类型的细分类型,例如 ANY[INT]

    • type 返回值以基本类型的类型值加 128 表示。

      a = array(ANY[DECIMAL32(2)], 0, 10)
      isColumnarTuple(a)
      typestr(a)
      // 旧版本返回 'ANY VECTOR'
      // 新版本返回 'ANY[DECIMAL32(2)] VECTOR'
      
      type(a)
      // 旧版本返回 int(25)
      // 新版本返回 int(165)
      
      b = table(10:0, `a`b`c, [INT, ANY[DECIMAL32(2)], DECIMAL64(4)])
      schema(b).colDefs
      /* 旧版本返回
      name typeString   typeInt extra comment
      ---- ------------ ------- ----- -------
      a    INT          4
      b    ANY          25
      c    DECIMAL64(4) 38      4
      */
      /* 新版本返回
      name typeString        typeInt extra comment
      ---- ----------------- ------- ----- -------
      a    INT               4
      b    ANY[DECIMAL32(2)] 165     2
      c    DECIMAL64(4)      38      4
      */
  • 内存表 INT 类型字段不再支持写入 STRING 类型数据:

    • 旧版本会尝试截取字符串中的数字并写入;

    • 新版本会报错。

      share streamTable(10000:0, `time`sym`price`qty`id, [TIMESTAMP, SYMBOL, INT, INT, DOUBLE]) as trades
      n = 500
      timev = temporalAdd(2012.01.01T11:24:56.245, take([1, 3, 5, 7], n).sort(), "s")
      symv = take(`AA`BB`CC, n)
      pricev = rand("A" + string(1..10), n)
      qtyv = rand(0..50 join int(), n)
      id = rand(1..100 join int(), n) * 0.01
      insert into trades values(timev, symv, pricev, qtyv, id)
      
      // 旧版本可以写入,会去掉 pricev 中的字母并转换为数字。
      // 新版本报错:Failed to append data to column 'price' with error: Failed to convert string to int: A2
  • 废弃原有 changelog 功能相关接口,包括 changelogStreamTablegetStreamTableChangelogpeekAppendStreamGraph::changelogSourceDStream::changelogSink

  • getStatelessMetrics 的返回值格式发生变化,返回表中的 outputMetricKeytriggerOn 字段会保留双引号:

    • 旧版本返回如 b:value1a:f1

    • 新版本返回如 "b" : "value1""a" : "f1"

  • INSTRUMENT 和 MKTDATA 类型的日期字段(如 referenceDatesettlementtermDates 等)只允许使用 DATE 类型:

    • 旧版本允许 STRING 或 DATE 类型;

    • 新版本不再支持 STRING 类型。

  • PKEY 主键引擎创建数据库时,仅支持 chunkGranularity = "TABLE",不再支持 chunkGranularity = "DATABASE"

  • JIT 发布和支持范围发生变化:

    • JIT 改为通过 libjit.so 动态库链接;Linux ABI=1 版本默认启用 JIT,可通过 isJIT() 确认是否加载成功。

    • 移除独立 JIT 安装包,且 JIT 不再兼容 Windows 系统。

    • 旧版本支持但新版本暂不支持的 JIT 用法包括:递归函数、响应式状态引擎相关功能、table(xxx as id) 形式的表达式、symbol vector、多语句赋值、对临时变量取值(如 a()[2])、元编程、module、类对象向量、基于 int128 的类型(包括 INT128、IPADDR、UUID、COMPLEX、POINT)、变量在确定类型后进行类型变更、高阶函数符号,以及部分字典键值类型。

缺陷修复带来的系统影响

  • complex 输入矩阵时的返回形式发生变化:

    • 旧版本返回向量;

    • 新版本返回矩阵。

      x = matrix([0.75, 0.125, 0.0, 0.125],
                 [-0.25, 0.125, 0.0, 0.125],
                 [-0.0, 0.0517767, -0.75, 0.3017767],
                 [-0.0, -0.3017767, 0.75, -0.0517767])
      typestr(complex(x, 0))
      
      // 旧版本返回 'FAST COMPLEX VECTOR'
      // 新版本返回 'FAST COMPLEX MATRIX'
  • loadText 按指定 schema 将不符合数值格式的字符串转换为数值类型时,结果发生变化:

    • 旧版本会截取并转换字符串前缀中的数字;

    • 新版本转换结果为空值。

      t = table(["2013.06.13  13:30:10.008",
                 "2012.06.13 13:30:10",
                 "2012.06.13 13:30:10.008",
                 "13:30:10.008007006",
                 "2012.06.13 13:30:10.008007006"] as str)
      saveText(t, "compat_numeric.csv")
      schema = table(`str as name, `INT as type)
      t1 = loadText("compat_numeric.csv", ",", schema)
      print(t1)
      
      /* 旧版本返回
      str
      ----
      2013
      2012
      2012
      13
      2012
      */
      // 新版本返回全为空值

升级注意事项

  • 从 2.00.16 或 2.00.17 升级到 3.00.6 时,如果历史版本启用了 enhancedSecurityVerification 并执行过 lockUserunLockUsercreateUserresetPwdchangePwdsetIPConnectionLimit,需要先处理 ACL 日志兼容性:可配置 useOldAclLog=1 启动新版本,等待所有控制节点完成自动 checkpoint 后(完成日志为 Checkpoint completed, ACL fixed.),将 useOldAclLog 改为 0 或删除该配置,并重启集群所有节点。

  • 在 2.00.16 或 2.00.17 通过 backupSettings 生成的备份文件,如果在新版本中通过 restoreSettings 恢复,需要通过 serverVersion 指定备份文件生成时的 Server 版本,例如 serverVersion="200.16"serverVersion="200.17"

  • 如果 2.00.18 或 3.00.5 环境启用了流数据高可用,升级到 3.00.6 后,由于流数据高可用序列化格式发生变化,不支持回退到老版本。

  • 升级到 3.00.6 后,如果创建、删除或修改用户,或者触发 aclCheckPointtakeMasterCheckpoint,可能写入老版本无法识别的 ACL 日志或 checkpoint 数据,不支持回退到老版本。