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

DDL read and update by tikv's meta #103

Merged
merged 4 commits into from
Jul 12, 2019
Merged

DDL read and update by tikv's meta #103

merged 4 commits into from
Jul 12, 2019

Conversation

hanfei1991
Copy link
Member

No description provided.

@@ -6,7 +6,6 @@
#include <Debug/dbgFuncMockTiDBData.h>
#include <Debug/dbgFuncMockTiDBTable.h>
#include <Debug/dbgFuncRegion.h>
#include <Debug/dbgFuncSchema.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add them back.

@@ -61,25 +61,6 @@ class MockTiDB : public ext::singleton<MockTiDB>
};
using TablePtr = std::shared_ptr<Table>;

class MockSchemaSyncer : public JsonSchemaSyncer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it back too.

@@ -50,4 +50,25 @@ void TMTStorages::remove(TableID table_id)
storages.erase(it);
}

String TMTStorages::getDBName(DatabaseID id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put these craps into schema syncer, as they will only be used by schema syncer internally.

Copy link
Contributor

@zanmato1984 zanmato1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zanmato1984 zanmato1984 merged commit 98d09cf into ddl Jul 12, 2019
@hanfei1991 hanfei1991 deleted the hanfei/ddl branch July 15, 2019 14:48
zanmato1984 added a commit that referenced this pull request Aug 5, 2019
* Widen schema syncer with sync all semantic, add background schema sync service and do init sync on startup

* Finish widen some data types to avoid data rewriting during apply ddl

* Add update_timestamp into table info

* Refine read and flush to be more robust for schema change

* Fix nullable for overflow check when decode region cache

* Add schema state enum

* Support column type change in schema syncer

* Fix comment

* Add mock functions for TiDB DDL

* Fix rvalue ref

* Fix some bugs in schema syncer and mock tidb

* Adjust test

* Add alter test

* Not do data conversion for alter txn table, as we already stored widen data

* Fix typo

* Fix mock tidb reverse type mapping

* Enhance overflow checking when flushing

* Enhance alter test

* Refine some code

* Remove table region mapping when drop table

* Adjust drop order

* Print file path in mutable test script when error

* Fix insert widen data through sql

* Fix some txn tests

* Fix widen data write of import statement

* DDL read and update by tikv's meta (#103)

* DDL read and update by tikv's meta

* add dbg back

* refine test

* address comments

* Add schema version check before reading

* Fix build error

* Format

* Reorg schema syncer code

* Add lock control in schema syncer interface

* Refinement

* Add sync schema on read

* fix bug during creating column: use a wrong db name (#107)

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* fix ddl sync for table drop and truncate (#109)

* when we drop a table when flash server is closed, we should sync this
drop when restart flash server.

* Add schema sync on read and simplify schema syncer interface and adjust mock stuff (#108)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Fix build error

* Fix build error

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Remove useless codes (#112)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Fix build fail

* Fix alter tmt and pass schema tests (#114)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* sync default value from tidb to flash (#113)

- still need to support current_timestamp
- still need to support date/datetime/enum types.

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* [DDL] Pass all txn tests (#116)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Fix empty default value bug (#117)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read, and add drop on read test

* Remove a lot useless code (#118)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read logic and add test (#120)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read, and add drop on read test

* add schema_version for TableInfo (#122)

* add schema_version for TableInfo

In order to make read procedure more efficiently.

* address comment

* pass all tests

* fix bug for drop table; (#123)

* Support rename mock tidb table

* Add rename tests

* add logs for debug (#126)

* Add mock truncate table and tests

* Test rename table (#124)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read, and add drop on read test

* Support rename mock tidb table

* Add rename tests

* Add mock truncate table and tests

* tiny fix (#127)

* Add rename/truncate on read/write test and alter on read test

* Add rename/truncate on read/write test and alter on read test (#128)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read, and add drop on read test

* Support rename mock tidb table

* Add rename tests

* Add mock truncate table and tests

* Add rename/truncate on read/write test and alter on read test

* support for alter column. (#129)

* support for alter column.

* add log

* format

* address comment

* Fix mis-widen internal columns

* Support rename table. (#130)

* Fix fragile txn mock test

* Fix mis-widen internal columns (#133)

* Add sync schema on read

* Simplify schema syncer interface and adjust mock stuff

* Rename default schema version setting

* Compensate last commit

* Remove curl library

* Remove curl from builder image

* Remove useless codes, init schema syncer based on pd config

* Minor fix to schema debug

* Fix alter tmt and pass tests

* Fix build fail

* Add lock for mock schema syncer

* Fix schema sync service init context

* Adjust schema tests

* Not sync if no schema change detected

* Adjust txn mock tests

* Fix default value bug

* Rename some tests

* Remove sync schema test

* Remove a lot useless code

* Refine schema sync on read, and add drop on read test

* Support rename mock tidb table

* Add rename tests

* Add mock truncate table and tests

* Add rename/truncate on read/write test and alter on read test

* Fix mis-widen internal columns

* Fix fragile txn mock test again

* Remove useless code

* Resolve a dead lock problem during bootstraping. (#134)

* Resolve a dead lock problem during bootstraping.

* Merger will handle the structure lock of a storage. If merging is
earlier than syncing schema when bootstraping, merger is waiting for tmt
context's init, and schema syncer is waiting for the structure lock,
which cause dead lock :(

* add err code

* make log smarter

* format

* Fix dead lock in learner read (#135)

* Adjust order of region check and lock by region scanner creation (#136)

* Fix dead lock in learner read

* Adjust order of region check and lock by region scanner creation

* Remove useless invalid region version check

* Address comments

* address comment

* [FLASH-358] Support Region DeleteRange (#139)

* Address comments

* Fix test config based on new ddl

* fix drop db bug

* refine log

* Fix a ignore db config bug and add verbose pd addr

* Enlarge pd/kv/db startup waiting time

* Remove useless commands

* format client-c

* Address comments

* address comments

* hot fix

* Fix failed test

* Fix mutable tests by using no schema syncer

* fix. optimize background thread pool. (#153)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants