rethinkdb踩坑记录
来源:互联网 发布:mac口红持久吗 编辑:程序博客网 时间:2024/06/14 17:39
奇葩的错误日志
Rethinkdb自带的错误日志真的很奇葩, 会在日志里自带一堆反斜杠. 另外, 有的东西表述也不准确. 比如这个:
The server(s) hosting table abc.in are currently unreachable. The secondary index was not created. If youdo not expect the server(s) to recover, you can use emergency_repair to restore availability of the table.
我的操作是要在abc数据库中的t表内建立名为in的索引. 但给出的错误日志却是很奇怪的abc.in, 直接跳过了t表. 看这个错误日志以为是我尝试建立了一个abc数据库里in表中的索引, 但反复检查代码发现并非如此. 因此, 我查了一下源代码, 想确定一下是不是这个数据库日志有问题.
首先在源代码目录里找到这段日志的源头, 位于src/clustering/administration/admin_op_exc.hpp
:
#define CATCH_OP_ERRORS(db, name, error_out, no_msg, maybe_msg) \ catch (const failed_table_op_exc_t &) { \ *(error_out) = admin_err_t{ \ strprintf("The server(s) hosting table `%s.%s` are currently " \ "unreachable. " no_msg " If you do not expect the server(s) " \ "to recover, you can use `emergency_repair` to restore " \ "availability of the table. " \ "<http://rethinkdb.com/api/javascript/reconfigure/" \ "#emergency-repair-mode>", (db).c_str(), (name).c_str()), \ query_state_t::FAILED}; \ return false; \ }
可以看到, 这个日志的数据库名和表名是由CATCH_OP_ERRORS
这个宏定义代入的. 再回到宏定义引用的位置, src/clustering/administration/real_reql_cluster_interface.cc
:
CATCH_OP_ERRORS(db->name, name, error_out,"The secondary index was not created.","The secondary index may or may not have been created.")
可以看到, 第二个传参是由函数传参代入的, 函数原型为:
bool real_reql_cluster_interface_t::sindex_create( auth::user_context_t const &user_context, counted_t<const ql::db_t> db, const name_string_t &table, const std::string &name, const sindex_config_t &config, signal_t *interruptor_on_caller, admin_err_t *error_out)
sindex_create
由三个参数, db, table, name
, 分别是数据库名, 表的名字, 索引的名字. 因此, 实际上这里生成日志的时候, 跳过了表的名字而直接使用了索引的名字, 看起来让人费解, 这也就证明了我的猜想是正确的.
阅读全文
0 0
- rethinkdb踩坑记录
- RethinkDB介绍
- rethinkdb安装
- rethinkdb命令
- RethinkDB之初体验
- CentOS下安装RethinkDB
- [转]一个高性能的NoSQL: RethinkDB
- RethinkDB成为Linux基金会的一员
- Ubuntu 14.04安装RethinkDB 2.3.6
- RethinkDB 创始人总结的 57 条创业经验
- RethinkDB创始人教你如何找到创业创意(完整篇)
- RethinkDB创始人教你如何打造一个伟大的产品
- RethinkDB创始人教你如何找到创业点子
- 从RethinkDB的倒闭,反思国内外开源项目
- RethinkDB联合创始人分享的44条工程管理经验
- 使用RethinkDB与SpringBoot 搭建一个简单的聊天
- RethinkDB联合创始人分享的44条工程管理经验
- Go实战--golang中使用RethinkDB(gorethink/gorethink.v3)
- Spring RMI java.rmi.NoSuchObjectException: no such object in table
- 用类描述计算机中CPU的速度和硬盘的容量。要求Java的应用程序有4个类,名字分别是PC、CPU、HardDisk和Test,其中Test是主类。
- SpringMVC基础(一)
- 线程2
- webmagic总结
- rethinkdb踩坑记录
- 设计模式之单例模式
- Python中进程和线程的区别详解
- 二叉树——如何使用三种遍历中的两种推断出二叉树
- [LeetCode] 92. Reverse Linked List II
- VS2015配置EasyX图形库
- 公钥 私钥 证书 HTTPS那些事儿
- 小凯的疑惑
- 几种现在时间的获取方法和SimpleDateFormat匹配现在时间的格式