myrocks 的事务
来源:互联网 发布:世间始终你好知乎 编辑:程序博客网 时间:2024/06/13 07:38
myrocks 支持两种事务 一种是Rdb_writebatch_impl 另一种 是 Rdb_transaction_impl
前一种 将 将 一次batch 作为一次事务提交,而后一种 是 rocksdb 内置的事务了
而myrocks对事务的选择,可以从源码里看出 如果跳过 tx_api 并且是 在主从同步 使用 Rdb_writebatch_impl ,或者 在 master 跳过 tx_api 时,没有主从同步 ,也是用Rdb_writebatch_impl
Rdb_writebatch_impl 这种事务 缺少很多机制,没有Rdb_transaction_impl 健全,比如锁,batch 就没有
static Rdb_transaction *get_or_create_tx(THD *const thd) { Rdb_transaction *&tx = get_tx_from_thd(thd); // TODO: this is called too many times.. O(#rows) if (tx == nullptr) { if ((rpl_skip_tx_api && thd->rli_slave) || (THDVAR(thd, master_skip_tx_api) && !thd->rli_slave)) { tx = new Rdb_writebatch_impl(thd); } else { tx = new Rdb_transaction_impl(thd); } tx->set_params(THDVAR(thd, lock_wait_timeout), THDVAR(thd, max_row_locks)); tx->start_tx(); } else { tx->set_params(THDVAR(thd, lock_wait_timeout), THDVAR(thd, max_row_locks)); if (!tx->is_tx_started()) { tx->start_tx(); } } return tx;}
阅读全文
0 0
- myrocks 的事务
- myrocks ttl的使用
- myrocks 的 pk 的生成原理(k/v)
- MyRocks写入分析
- myrocks build 镜像
- myrocks proc init梳理
- myrocks store format 举例
- MySQL · 特性分析 · MyRocks简介
- oralce的自治事务(事务中的事务)
- 事务和事务的隔离
- Spring 的事务,分布式事务。
- 事务&事务的隔离级别
- Spring的事务,什么是事务?
- 事务及事务的特性
- 事务的定义,事务的作用以及Spring事务原理
- 事务的定义,事务的作用以及Spring事务原理
- 事务的定义,事务的作用以及Spring事务原理
- 事务的定义,事务的作用以及Spring事务原理
- 欢迎使用CSDN-markdown编辑器
- 获取用户openid+OAuth2.0网页授权(PHP版本)+JSSDK认证(java版本)
- RxJava 与 Retrofit 结合的最佳实践
- 3-7 一笔画
- CCF之工资计算
- myrocks 的事务
- c语言结构类型小结
- 将String放在List<Integer>内
- 爬数据出现错误javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException
- How to compare the differences of the same file in the two nodes
- 同样的神经网络引擎,苹果A11芯片比华为麒麟970牛在哪?
- 基于fiddler插件开发的移动测试网络监控与分析
- spring boot学习(九)---单元测试
- java设计模式04