-
Notifications
You must be signed in to change notification settings - Fork 412
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
[FLASH-461/471] Basic read/write StorageDeltaMerge's table through Raft #217
[FLASH-461/471] Basic read/write StorageDeltaMerge's table through Raft #217
Conversation
@@ -208,6 +208,7 @@ void InterpreterSelectQuery::getAndLockStorageWithSchemaVersion(const String & d | |||
if (!storage_) | |||
return std::make_tuple(nullptr, nullptr, DEFAULT_UNSPECIFIED_SCHEMA_VERSION, false); | |||
|
|||
// TODO handle if storage_ is a DeltaMerge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FLASH-469
|
||
static const ColumnDefine VERSION_COLUMN_DEFINE{VERSION_COLUMN_ID, VERSION_COLUMN_NAME, VERSION_COLUMN_TYPE}; | ||
static const ColumnDefine TAG_COLUMN_DEFINE{TAG_COLUMN_ID, TAG_COLUMN_NAME, TAG_COLUMN_TYPE}; | ||
inline ColumnDefine getVersionColumnDefine() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use static object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Column name and type are defined in class ::DB::MutableSupport
now, and C++ don't ensure the order of init for static object in different compile unit.
If we use static object here, we will get empty column name and nullptr as column type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe static local object? Like
inline const ColumnDefine & EXTRA_HANDLE_COLUMN()
{
static ColumnDefine VERSION_COLUMN_DEFINE_{VERSION_COLUMN_ID, VERSION_COLUMN_NAME, VERSION_COLUMN_TYPE};
return VERSION_COLUMN_DEFINE_;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
afb8ffc
to
0f63c48
Compare
b25da45
to
8ded428
Compare
/run-integration-tests |
/run-integration-tests |
1 similar comment
/run-integration-tests |
b00a3a1
to
3d2ebf7
Compare
/run-integration-tests |
1 similar comment
/run-integration-tests |
/rebuild |
1 similar comment
/rebuild |
/run-integration-tests |
LGTM |
MutableSupport::storage_name -> MutableSupport::mmt_storage_name
2e25424
to
5c7e00a
Compare
/run-integration-tests |
…ft (pingcap#217) ## Changes * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) ## Changes * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) ## Changes * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
…ft (pingcap#217) * Add enum StorageEngine for indicating which storage engine to use * `DBGInvoke mock_tidb_table` now support Engine=DeltaMerge * We can specify default storage engine by raft.storage_engine in tiflash.xml * Use `IManageableStorage` as interface for Storages synced from TiDB * TMTStorages now store ptr to IManageableStore instead of StorageMergeTree * Add `StorageDeltaMerge::deleteRange` * Support `applySnapshot` by using `StorageDeltaMerge::deleteRange` * Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h * Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like `DBGInvoke try_flush_region`
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Changes
Add enum StorageEngine for indicating which storage engine to use
DBGInvoke mock_tidb_table
now support Engine=DeltaMergeWe can specify default storage engine by raft.storage_engine in tiflash.xml
Use
IManageableStorage
as interface for Storages synced from TiDBTMTStorages now store ptr to IManageableStore instead of StorageMergeTree
Add
StorageDeltaMerge::deleteRange
Support
applySnapshot
by usingStorageDeltaMerge::deleteRange
Use ::DB::MutableSupport for constant naming in DeltaMergeDefines.h
Note that we can NOT read data in KVStore by now, we must flush data to StorageDeltaMerge by using some commands like
DBGInvoke try_flush_region
Steps to debug for DeltaMerge table
mock_tidb_table
,refresh_schemas
,put_region
raft_insert_row
,try_flush_region
TODO
ApplySnapshot.cpp
(FLASH-392) @marsishandsomegetHandleMapByRange<Int64>
can handle all non UInt64 pk-typeInsideThis is only called by TMT.RegionDataMover::getHandleMapByRange
, callcreateBlockInputStreamFromRange
. Is DeltaMerge table supportSELRAW NOKVSTORE ...
?5. Bug: Try to lock mutex after mutex is free (FLASH-468)Done @ b00a3a1
6. Bug: If write throw exception, that region can not write any moreDone @ b054cdf, merged to master in this commit 1509cfe