Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add disktable to tablet and nameserver #1483

Merged
merged 102 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 101 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
1768d60
add rocksdb dep in third-party
zhanghaohit Feb 22, 2022
3b365e8
feat: move back disk-table source files
Leowner Feb 22, 2022
523184e
Feat: move back disk_snapshot
Leowner Feb 22, 2022
ca0e185
disk_table test
Leowner Feb 22, 2022
ab3b1a4
fix pr comment
Feb 26, 2022
dfd3b40
fix: rocksdb compile issue
zhanghaohit Feb 28, 2022
2248dbb
fix: BUILD_BUNDLED_ROCKSDB to ON
zhanghaohit Feb 28, 2022
9b8a406
fix: quickfix rocksdb dep in docker image
zhanghaohit Feb 28, 2022
daa15bd
remove all extra spaces
Feb 28, 2022
07e4bdd
remove blank lines and update copyright
Feb 28, 2022
fcbd978
format disk table
Feb 28, 2022
fa87245
remove redundant typedef and change declare order
Mar 1, 2022
2d36487
rebase with feat/disk-table
Mar 1, 2022
bc9060b
remove Release in disktable
Mar 1, 2022
d369727
remove db_root_path from memtable
Mar 1, 2022
e847637
move Table::CreateTable to test
Mar 2, 2022
e9490f5
change disk table root_path to table_path
Mar 2, 2022
b6d1dfe
rebase tablet client.cc
Mar 2, 2022
1b2c6ce
change name of recycle bin and add tests
Mar 2, 2022
3c05c66
add some tests in tablet
Mar 3, 2022
05c1e87
fix test DelRecycleDisk
Mar 3, 2022
30ff8af
add some test in nameserver
Mar 3, 2022
49aea71
add more test to tablet
Mar 3, 2022
f7d85d1
add more tests to tablet
Mar 3, 2022
6fa728b
add more tests to tablet
Mar 4, 2022
432b7c9
add some storage mode to tablet
Mar 4, 2022
334aa51
fix decode timestamp from value in disktable
Mar 8, 2022
009cfd1
fix some tests in tablet
Mar 8, 2022
efb8842
Merge branch 'feat/disk-table' into feat/add_to_nameserver_rebase
Mar 8, 2022
57bd814
remove create table factory method from tablet
Mar 8, 2022
1b56658
fix: disktable::put will get all ts_cols from dimension
Mar 9, 2022
a35e219
fix: disktable::put will get all ts_cols from dimension
Mar 9, 2022
57128d6
update include order
Mar 9, 2022
dd2ea1c
update include order
Mar 9, 2022
26a4e39
Merge branch 'feat/disk-table' into feat/add_to_nameserver_rebase
Mar 10, 2022
e191eb0
fix abs and/or lat test in tablet
Mar 10, 2022
3d8abc9
fix 2 tests in tablet
Mar 10, 2022
64a52a8
temporarily change remove to recursive
Mar 10, 2022
49dead8
update disk table test
Mar 11, 2022
a3e956c
remove whitespaces in line end
Mar 11, 2022
f1c3eca
fix getTermPairDisk
Mar 11, 2022
5d39010
update two test in nameserver
Mar 14, 2022
bce502c
update tests in nameserver
Mar 14, 2022
ef6f732
update nameserver test
Mar 14, 2022
8e0752e
update ts_col in disktable using uint32_t
Mar 15, 2022
5671f9c
update tests with TEST_P
Mar 15, 2022
65d15d3
remove whitespace
Mar 15, 2022
50cfda7
update nameserver test
Mar 15, 2022
f479be1
remove unused environment in nameserver
Mar 15, 2022
7351346
Merge commit '65d15d32d4c314c784f222218ea883991c25fab9' into feat/add…
Mar 17, 2022
a2896db
update all tests in tablet
Mar 17, 2022
1d9d963
update tablet test
Mar 17, 2022
3fa5629
change recycle path
Mar 18, 2022
de369df
add comments for different behaviors
Mar 18, 2022
649df72
Merge remote-tracking branch 'upstream/main' into feat/add_to_nameser…
Mar 20, 2022
7a7814c
update tests in nameserver create remote test
Mar 21, 2022
4390040
update standalone test
Mar 21, 2022
f011fb8
update tests in tablet, one failed in projection left
Mar 22, 2022
47b331c
update tablet multi path test
Mar 22, 2022
955d82f
update tablet impl func test
Mar 22, 2022
878c631
update style
Mar 23, 2022
ecd0889
remove whitespaces
Mar 23, 2022
4108cf6
fix test failed in projection
Mar 23, 2022
a7cb58f
remove debug log
Mar 30, 2022
08c71f9
add DiskTableKeyIterator (not finished)
Apr 4, 2022
51f0480
add functions in DiskTableKeyIterator
Apr 4, 2022
a576e8e
add disktableRowIterator
Apr 4, 2022
dd2b372
Merge branch 'main' into feat/add_to_nameserver_rebase
zhanghaohit Apr 5, 2022
76e6dec
fix merge issue
zhanghaohit Apr 5, 2022
25b6269
revert disk table window iterator (put in another pr)
zhanghaohit Apr 6, 2022
7a10b0e
fix some special handling for storage mode
zhanghaohit Apr 6, 2022
52fc321
fix compile error
zhanghaohit Apr 6, 2022
829fea3
fix gc_interval
zhanghaohit Apr 6, 2022
042e945
fix gc test
zhanghaohit Apr 6, 2022
9b99b91
fix talbet test
zhanghaohit Apr 7, 2022
ca58762
Merge branch 'main' into feat/add_to_nameserver_rebase
zhanghaohit Apr 7, 2022
1cc6564
set flags_root_path default to "", use TEST_P
Apr 11, 2022
cef7029
add error message
Apr 11, 2022
8074df9
add ssd test to nameserver
Apr 12, 2022
aa7cfd7
fix error code, ssd path, childFileName
Apr 12, 2022
9805212
Merge remote-tracking branch 'upstream/main' into pr/Leowner/1483
Apr 13, 2022
400b4ac
merge main
Apr 13, 2022
c66eb42
change /tmp/1 to /tmp/rand()
Apr 14, 2022
3432afc
Merge commit '1c05af68823819b1e4e132c382018dc242b61aa8' into pr/Leown…
Apr 14, 2022
9885125
add disktable in SchedMakeSnapshot
Apr 14, 2022
bc1fbfc
add GetCount for DiskTable
Apr 16, 2022
2489157
fix cpplint
Apr 16, 2022
30da066
Merge branch 'main' into pr/Leowner/1483
Apr 17, 2022
63b6f86
move getCount to table.h, change root_path default
Apr 18, 2022
73bdcdf
Merge remote-tracking branch 'upstream/main' into pr/Leowner/1483
Apr 18, 2022
481e517
fix GetCount
Apr 18, 2022
756b4e2
add initialization to GetCount
Apr 18, 2022
e88726d
"rename first in case we fail to recover" in TabletImpl::LoadDiskTabl…
Apr 18, 2022
7c0a410
change consistent storageMode
Apr 18, 2022
709f1e2
add log for disk table GetCount
Apr 18, 2022
2972f63
fix recycle_bin
Apr 18, 2022
8ecdfab
fix LoadDiskTableInternal
Apr 19, 2022
8cf3686
remove reversion in LoadDiskTableInternal
Apr 19, 2022
b3c2e2f
Merge remote-tracking branch 'upstream/main' into pr/Leowner/1483
Apr 19, 2022
a7cc8ad
fix cpplint
Apr 19, 2022
bf952f0
change error code
Apr 19, 2022
6964656
fix create root path
Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/client/tablet_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ bool TabletClient::Put(uint32_t tid, uint32_t pid, uint64_t time, const std::str
return false;
}



bool TabletClient::Put(uint32_t tid, uint32_t pid, const char* pk, uint64_t time, const char* value, uint32_t size,
uint32_t format_version) {
::openmldb::api::PutRequest request;
Expand Down Expand Up @@ -523,12 +521,13 @@ bool TabletClient::DeleteOPTask(const std::vector<uint64_t>& op_id_vec) {
return true;
}

bool TabletClient::GetTermPair(uint32_t tid, uint32_t pid, uint64_t& term, uint64_t& offset, bool& has_table,
bool& is_leader) {
bool TabletClient::GetTermPair(uint32_t tid, uint32_t pid, ::openmldb::common::StorageMode storage_mode, uint64_t& term,
uint64_t& offset, bool& has_table, bool& is_leader) {
::openmldb::api::GetTermPairRequest request;
::openmldb::api::GetTermPairResponse response;
request.set_tid(tid);
request.set_pid(pid);
request.set_storage_mode(storage_mode);
Leowner marked this conversation as resolved.
Show resolved Hide resolved
zhanghaohit marked this conversation as resolved.
Show resolved Hide resolved
bool ret = client_.SendRequest(&::openmldb::api::TabletServer_Stub::GetTermPair, &request, &response,
FLAGS_request_timeout_ms, FLAGS_request_max_retry);
if (!ret || response.code() != 0) {
Expand All @@ -543,11 +542,13 @@ bool TabletClient::GetTermPair(uint32_t tid, uint32_t pid, uint64_t& term, uint6
return true;
}

bool TabletClient::GetManifest(uint32_t tid, uint32_t pid, ::openmldb::api::Manifest& manifest) {
bool TabletClient::GetManifest(uint32_t tid, uint32_t pid, ::openmldb::common::StorageMode storage_mode,
Leowner marked this conversation as resolved.
Show resolved Hide resolved
Leowner marked this conversation as resolved.
Show resolved Hide resolved
::openmldb::api::Manifest& manifest) {
::openmldb::api::GetManifestRequest request;
::openmldb::api::GetManifestResponse response;
request.set_tid(tid);
request.set_pid(pid);
request.set_storage_mode(storage_mode);
bool ret = client_.SendRequest(&::openmldb::api::TabletServer_Stub::GetManifest, &request, &response,
FLAGS_request_timeout_ms, FLAGS_request_max_retry);
if (!ret || response.code() != 0) {
Expand Down Expand Up @@ -974,10 +975,11 @@ bool TabletClient::DisConnectZK() {
return true;
}

bool TabletClient::DeleteBinlog(uint32_t tid, uint32_t pid) {
bool TabletClient::DeleteBinlog(uint32_t tid, uint32_t pid, openmldb::common::StorageMode storage_mode) {
::openmldb::api::GeneralRequest request;
request.set_tid(tid);
request.set_pid(pid);
request.set_storage_mode(storage_mode);
::openmldb::api::GeneralResponse response;
bool ok = client_.SendRequest(&::openmldb::api::TabletServer_Stub::DeleteBinlog, &request, &response,
FLAGS_request_timeout_ms, 1);
Expand Down
5 changes: 3 additions & 2 deletions src/client/tablet_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,19 @@ class TabletClient : public Client {
bool UpdateTTL(uint32_t tid, uint32_t pid, const ::openmldb::type::TTLType& type, uint64_t abs_ttl,
uint64_t lat_ttl, const std::string& index_name);

bool DeleteBinlog(uint32_t tid, uint32_t pid);
bool DeleteBinlog(uint32_t tid, uint32_t pid, ::openmldb::common::StorageMode storage_mode);

bool GetTaskStatus(::openmldb::api::TaskStatusResponse& response); // NOLINT

bool DeleteOPTask(const std::vector<uint64_t>& op_id_vec);

bool GetTermPair(uint32_t tid, uint32_t pid,
::openmldb::common::StorageMode storage_mode, // NOLINT
dl239 marked this conversation as resolved.
Show resolved Hide resolved
uint64_t& term, // NOLINT
uint64_t& offset, bool& has_table, // NOLINT
bool& is_leader); // NOLINT

bool GetManifest(uint32_t tid, uint32_t pid,
bool GetManifest(uint32_t tid, uint32_t pid, ::openmldb::common::StorageMode storage_mode,
::openmldb::api::Manifest& manifest); // NOLINT

bool GetTableStatus(::openmldb::api::GetTableStatusResponse& response); // NOLINT
Expand Down
3 changes: 3 additions & 0 deletions src/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ DEFINE_uint32(replica_num, 3,
"config the default replica_num. if set 3, there is one leader and two followers");
DEFINE_uint32(system_table_replica_num, 1, "config the default replica_num of system table.");
DEFINE_int32(gc_interval, 120, "the gc interval of tablet every two hour");
DEFINE_int32(disk_gc_interval, 120, "the rocksdb gc interval of tablet");
DEFINE_int32(gc_pool_size, 2, "the size of tablet gc thread pool");
DEFINE_int32(gc_safe_offset, 1, "the safe offset of tablet gc in minute");
DEFINE_uint64(gc_on_table_recover_count, 10000000, "make a gc on recover count");
Expand Down Expand Up @@ -119,6 +120,8 @@ DEFINE_int32(snapshot_pool_size, 1, "the size of tablet thread pool for making s
DEFINE_uint32(load_index_max_wait_time, 120 * 60 * 1000, "config the max wait time of load index");

DEFINE_string(recycle_bin_root_path, "/tmp/recycle", "specify the root path of recycle bin");
DEFINE_string(recycle_bin_ssd_root_path, "", "specify the root path of recycle bin in ssd");
DEFINE_string(recycle_bin_hdd_root_path, "", "specify the root path of recycle bin in hdd");
DEFINE_bool(recycle_bin_enabled, true, "enable the recycle bin storage");
DEFINE_uint32(recycle_ttl, 0, "ttl of recycle in minute");

Expand Down
Loading