baidu / baikaldb Goto Github PK
View Code? Open in Web Editor NEWBaikalDB, A Distributed HTAP Database.
License: Apache License 2.0
BaikalDB, A Distributed HTAP Database.
License: Apache License 2.0
house.baidu.com
could you provide RPM on CentOS 7 and CentOS 8? if provided will be easy to use and to PoC ,also helpful to product standardization and promotion. Desire it
truncate 清空表后,重新插入数据,自增id从清空表前的数值开始增加
1. 创建表(设置id自增长)
2. 插入数据
3. 查询插入数据
4. 执行truncate 清空表语句
5. 插入数据
6. 查询插入数据
详细操作步骤:
mysql>
mysql> CREATE TABLE `TestBK`.`info` (
-> `id` INT NOT NULL AUTO_INCREMENT,
-> `name` CHAR(25) NOT NULL,
-> PRIMARY KEY (`id`))ENGINE=Rocksdb DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=100 COMMENT='{"comment":"", "resource_tag":"", "namespace":"TEST"}';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into TestBK.info (name) values ('XE9HE'), ('RYF86'), ('GKJ79');
Query OK, 3 rows affected (0.00 sec)
mysql> select id, name from TestBK.info;
+----+-------+
| id | name |
+----+-------+
| 1 | XE9HE |
| 2 | RYF86 |
| 3 | GKJ79 |
+----+-------+
3 rows in set (0.01 sec)
mysql> truncate table TestBK.info;
Query OK, 0 rows affected (0.00 sec)
mysql> select id, name from TestBK.info;
Empty set (0.01 sec)
mysql> insert into TestBK.info (name) value ('HULLZ'), ('DPDJE'), ('LY36M');
Query OK, 3 rows affected (0.00 sec)
mysql> select id, name from TestBK.info;
+----+-------+
| id | name |
+----+-------+
| 4 | HULLZ |
| 5 | DPDJE |
| 6 | LY36M |
+----+-------+
3 rows in set (0.01 sec)
mysql>
truncate语句应当具有删除数据及初始化自增id的功能
BaikalDB/src/common/datetime.cpp
Line 104 in 0bb7db7
请问baikaldb是行列式存储吗?相关的源码在哪个文件
OS
zlm@instance-dq9qt6ci:~/BaikalDB$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
以前没有用过bazel,不知道是什么问题(看起来像是第三方包源失效了)
In my view, BaikalDB have the same architecture with TiDB after read the README of BaikalDB, I want to know the advantages of BaikalDB compared to TiDB.
全局索引时table_info的table_id是索引id, main_table_id是真正的table_id, set_region_info时,需进行判断。
数据库是否支持动态分片?如果支持是如何实现的呢?查询过程中也可以根据负载动态分配数据嘛?
支持哪些事务隔离级别哈 ?
支持 Serializable 隔离级别么?
ERROR: /home/happen/mycode/BaikalDB/BUILD:506:1: Linking of rule '//:baikalMeta' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -o bazel-out/k8-fastbuild/bin/baikalMeta -pthread '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,-S ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-fastbuild/bin/external/com_github_brpc_brpc/_objs/brpc/gzip_compress.pic.o:gzip_compress.cpp:function brpc::policy::GzipCompress(google::protobuf::Message const&, butil::IOBuf*): error: undefined reference to 'google::protobuf::io::GzipOutputStream::Options::Options()'
类似tidb于tikv的关系,使得底层的分布式kv由明显的分界,这样可以在kv的基础上开发非sql的基础应用
通过分析代码,发现在region split 是会先创建一个新的region,这是在这个region中只有一个peer,在非tail的分类时,一般就是原来region的leader节点,这时会写本地rocksdb,并且通过短暂阻塞读写实现新的region和老的region的数据保持一致,这是就会更新table 的版本,这样在后续的数据读写时就会使用新的视图(新的region info),这样新的region就可以接收数据读写了,但当新的region可以接收数据读写时,并没有保证当前的raft group 已经有足够多的peer,如果这时出现节点异常,就可能会导致数据丢失。
从代码分析看region的peer增加是通过心跳处理,在RegionManager::check_peer_count 中判断副本数据不足时才选择添加新的实例到raft group的,而这个过程与region split是互相独立的,并没有发现怎样保证在一个raft group有足够多的peer时,才开始接收新的数据的协同
1.在百度内部的生成环境中,但节点上拥有的region个数为多少?即一个节点能够支持多少raft group
2.由于braft针对raft group 各个资源基本上是完全独立了,过多的raft group是否会造成资源消耗过多,如多多的心跳
I have deployed three components successfully, but I don't know how to use it. How to execute sql in Create table
in the readme.md?
在BaikalDB里面,每个Region的没有使用braft自带了定时快照功能,而是使用单独一个线程,同一个时刻只允许指定个数的Region做快照。
Lines 626 to 639 in 90a7ef6
在Region里面也不是说做快照就做快照的, 也是通过时间和log条数相差到达一定时才让做。
Lines 1779 to 1805 in 90a7ef6
那为啥在install snapshot,node从leader获取快照时却是使用rocksdb接口get_snapshot,直接使用当前的快照?每个SnapshotContext 是install snapshot时才构造出来的。
BaikalDB/include/raft/rocksdb_file_system_adaptor.h
Lines 44 to 61 in 90a7ef6
是不是因为在on_apply中保存了_applied_index, 重复的数据可以通过 if (iter.index() <= _applied_index) { continue; } 过滤掉呢?
Lines 1336 to 1362 in 90a7ef6
这样是可以过滤掉, 但节点所installed snaoshot 其实并不是leader on_snapshot_save时所保存的snaoshot 了。
这个数据库适合存储物联网大量数据采集么?
ERROR: /home/BaikalDB/BUILD:453:1: C++ compilation of rule '//:sqlparser' failed (Exit 1)
include/sqlparser/sql_parse.y:18:1: error: expected unqualified-id before '%' token
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/new:40:0,
from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ext/new_allocator.h:33,
from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/bits/c++allocator.h:33,
from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/allocator.h:46,
from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/string:41,
from include/sqlparser/parser.h:16,
from include/sqlparser/sql_parse.y:22:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/exception:35:37: error: expected declaration before end of line
#pragma GCC visibility push(default)
Environment:
OS: CentOS 7
bazel version : 0.16.0
gcc version: 4.8.5
I have followed the instructions in the README.md.
如题!
hi,啥时候能给出一个性能报告呢?
Line 346 in b894219
提个小小的建议哦,
祝baikaldb 成功!
如果支持的话,使用方式是否和mysql一致?
Line 174 in 90a7ef6
分析代码发现 whether_legal_for_select_instance 只是按照一下规则进行选择resource_tag相同, 不在exclude_stores之内, logical_room相同,而在一种一般的场景下如:
一个机器有多块SSD,而针对每一个SSD会启动一个store的实例,当进行region分配时,我们需要针对一个raft group 需要在不同的机器上才能保证数据的安全,为了实现这样的目标我们需要怎样实现配置?
curl -v -o 5_1584106435_60936.sst http://$1/StoreService/backup_region/download/5/data/0
少数据量的时候可以get,没问题,但是大文件的status_code:500的错误.
问题描述: TIME类型列插入显示异常。
重现步骤:
mysql> CREATE TABLE `TestDB`.`test` (
-> `id` INTEGER NOT NULL,
-> `Pro_time` TIME default '20:27:07',
-> PRIMARY KEY (`id`))ENGINE=Rocksdb;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test(id) values(1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values(2,"20:07:03");
Query OK, 1 row affected (0.00 sec)
mysql> select * from test;
+----+-----------+
| id | Pro_time |
+----+-----------+
| 1 | -01:06:36 |
| 2 | -01:01:34 |
+----+-----------+
2 rows in set (0.00 sec)
RT,ut只有test_date_time编译了二进制,但是测试不通过。其他ut没有编译产出
如题
如题,当数据量特别大时,全量备份会导致本分时间特别长,是否考虑做增量备份?
请问 BaiKalDB 是百度 Palo 的开源版本吗? 本项目可用在生产环境吗?
编译环境:
centos 7.7.1908
gcc 8.3.1
In file included from /home/work/workspace/BaikalDB/include/common/log.h:22,
from /home/work/workspace/BaikalDB/include/common/common.h:48,
from /home/work/workspace/BaikalDB/include/engine/rocks_wrapper.h:25,
from /home/work/workspace/BaikalDB/include/raft/log_entry_reader.h:17,
from /home/work/workspace/BaikalDB/src/raft/log_entry_reader.cpp:15:
/usr/local/include/braft/storage.h: In function 'int braft::gc_dir(const string&)':
/usr/local/include/braft/storage.h:116:9: error: 'COMPACT_GOOGLE_LOG_NOTICE' was not declared in this scope
LOG(NOTICE) << "Target path not exist, so no need to gc, path: "
^~~
/usr/local/include/braft/storage.h:116:9: note: suggested alternative: 'COMPACT_GOOGLE_LOG_FATAL'
In file included from /home/work/workspace/BaikalDB/src/raft/log_entry_reader.cpp:16:
/home/work/workspace/BaikalDB/include/raft/my_raft_log_storage.h: At global scope:
/home/work/workspace/BaikalDB/include/raft/my_raft_log_storage.h:99:9: error: 'int baikaldb::MyRaftLogStorage::append_entries(const std::vector<braft::LogEntry*>&)' marked 'override', but does not override
int append_entries(const std::vector<braft::LogEntry*>& entries
^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/baikaldb.dir/build.make:245: CMakeFiles/baikaldb.dir/src/raft/log_entry_reader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/baikaldb.dir/all] Error 2
看起来是glog和braft没找到。我已经把这两个库都安装到了/usr/local/include 和 /usr/local/lib。
求问下怎么处理。
另外,CMakeLists.txt第15行, find_library(RAPIDJSON_LIB NAMES glog)
是不是应该改为find_library(RAPIDJSON_LIB NAMES rapidjson)
如题
BaikalDB/include/sqlparser/sql_parse.y
Lines 3151 to 3158 in b894219
请问BaikalDB是否有方案抓取数据库中的变更以进行数据同步; 类似mysql的binlog
why we use rocksdb 2pc rather than rocksdb transaction db as the local transaction for gloabal transaction?
项目开源已经有一段时间了,是不是节点扩容的功能,是在内部使用的基础,这个开源版本能在生产中使用吗?还有就是性能相当tidb有优势没?
hi Admin,
I compiled BaikalDB from source
git clone --recurse https://github.com/baidu/BaikalDB.git
cd BaikalDB
mkdir -p _build && cd _build
cmake -DWITH_BAIKAL_CLIENT=ON -DWITH_SYSTEM_LIBS=OFF -DCMAKE_BUILD_TYPE:STRING=Release ../
make all -j 4
I see these errors :
/mnt/data/temp/baidu/BaikalDB/_build/third-party/rocksdb/src/extern_rocksdb/./util/compression.h:115: undefined reference to ZSTD_freeDCtx' /mnt/data/temp/baidu/BaikalDB/_build/third-party/rocksdb/src/extern_rocksdb/./util/compression.h:367: undefined reference to
ZSTD_freeCCtx'
/mnt/data/temp/baidu/BaikalDB/_build/third-party/rocksdb/src/extern_rocksdb/./util/compression.h:191: undefined reference to `ZSTD_freeCDict'
collect2: error: ld returned 1 exit status
CMakeFiles/baikalMeta.dir/build.make:419: recipe for target 'baikalMeta' failed
make[2]: *** [baikalMeta] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/baikalMeta.dir/all' failed
make[1]: *** [CMakeFiles/baikalMeta.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
RT. sample
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.