【主题】analyze 报-6错误
【环境】sequoiadb 2.0与自带的fdw postgresql 9.3.4原生版本
【问题描述】
按照信息中心的步骤部署好sequoiadb与postgresql+fdw,查询一切正常,但是analyze命令报-6错误
报错的操作在coord节点中不产生任何错误日志。
foo=# analyze test ;
ERROR: unable to fetch next record, rc = -6
HINT: Make sure collection exists on remote SequoiaDB database, and the server is still up and running
foo=# select * from test ;
name | age | salary | gender
----------+-----+--------+--------
Tao Wang | 40 | 10000 | m
王涛 | 40 | 10000 | m
Eric Li | 45 | 15000 | m
李学雄 | 45 | 15000 | m
(4 rows)
foo=# analyze test1 ;
ERROR: unable to fetch next record, rc = -6
HINT: Make sure collection exists on remote SequoiaDB database, and the server is still up and running
foo=# select * from test1 limit 10 ;
hello | key
-------+-----
world | 0
world | 1
world | 2
world | 3
world | 4
world | 5
world | 6
world | 7
world | 8
world | 9
(10 rows)
【问题解决】
cache缓存优化时, 将SdbQuery从SdbBeginForeignScan移动到了SdbIterateForeignScan中,
但是在analyze流程中还需要依赖SdbBeginForeignScan中的SdbQuery获取cusor句柄, 移动后导致该cusor无效而报错。
需要将SdbQuery添加到analyze流程中。
【参考链接】
常见错误处理指南
错误码