DigitalChinaOpenSource / TiDB-for-PostgreSQL

PgSQL compatible on distributed database TiDB
Apache License 2.0
386 stars 21 forks source link

I hava a pd-server question #2

Closed KevinYang19 closed 3 years ago

KevinYang19 commented 3 years ago

When I execute follow command, I'm in trouble

./pd-server --name=pd1 --data-dir=pd1 --client-urls="http://localhost:2379" --peer-urls="http://localhost:2380" -L "info" --log-file=pd.log

failed to get tidb schema version

[2021/06/10 16:19:02.034 +08:00] [INFO] [etcd.go:576] ["serving peer traffic"] [address=127.0.0.1:2380]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:923] ["ee8770e2b82d270a is starting a new election at term 2"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:729] ["ee8770e2b82d270a became pre-candidate at term 2"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:824] ["ee8770e2b82d270a received MsgPreVoteResp from ee8770e2b82d270a at term 2"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:713] ["ee8770e2b82d270a became candidate at term 3"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:824] ["ee8770e2b82d270a received MsgVoteResp from ee8770e2b82d270a at term 3"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [raft.go:765] ["ee8770e2b82d270a became leader at term 3"]
[2021/06/10 16:19:03.525 +08:00] [INFO] [node.go:325] ["raft.node: ee8770e2b82d270a elected leader ee8770e2b82d270a at term 3"]
[2021/06/10 16:19:03.530 +08:00] [INFO] [server.go:2016] ["published local member to cluster through raft"] [local-member-id=ee8770e2b82d270a] [local-member-attributes="{Name:pd1 ClientURLs:[http://localhost:2379]}"] [request-path=/0/members/ee8770e2b82d270a/attributes] [cluster-id=2b6c1f350c95acd6] [publish-timeout=11s]
[2021/06/10 16:19:03.530 +08:00] [INFO] [server.go:291] ["create etcd v3 client"] [endpoints="[http://localhost:2379]"] [cert="{\"cacert-path\":\"\",\"cert-path\":\"\",\"key-path\":\"\",\"cert-allowed-cn\":null}"]
[2021/06/10 16:19:03.531 +08:00] [INFO] [serve.go:139] ["serving client traffic insecurely; this is strongly discouraged!"] [address=127.0.0.1:2379]
[2021/06/10 16:19:03.533 +08:00] [INFO] [server.go:313] ["update advertise peer urls"] [from=http://localhost:2380] [to=http://10.0.23.47:2380]
[2021/06/10 16:19:03.534 +08:00] [INFO] [server.go:343] ["init cluster id"] [cluster-id=6972062380264930987]
[2021/06/10 16:19:03.553 +08:00] [WARN] [history_buffer.go:139] ["load history index failed"] [error="leveldb: not found"]
[2021/06/10 16:19:03.553 +08:00] [INFO] [history_buffer.go:147] ["start from history index"] [start-index=0]
[2021/06/10 16:19:03.554 +08:00] [INFO] [server.go:1112] ["start to campaign leader"] [campaign-leader-name=pd1]
[2021/06/10 16:19:03.556 +08:00] [INFO] [server.go:1131] ["campaign leader ok"] [campaign-leader-name=pd1]
[2021/06/10 16:19:03.558 +08:00] [INFO] [tso.go:158] ["sync and save timestamp"] [last=2021/06/10 15:56:12.817 +08:00] [save=2021/06/10 16:19:06.558 +08:00] [next=2021/06/10 16:19:03.558 +08:00]
[2021/06/10 16:19:03.560 +08:00] [INFO] [server.go:1220] ["server enable region storage"]
[2021/06/10 16:19:03.561 +08:00] [INFO] [id.go:114] ["idAllocator allocates a new id"] [alloc-id=2000]
[2021/06/10 16:19:03.561 +08:00] [INFO] [util.go:78] ["load cluster version"] [cluster-version=0.0.0]
[2021/06/10 16:19:03.561 +08:00] [INFO] [server.go:1164] ["PD cluster leader is ready to serve"] [leader-name=pd1]
[2021/06/10 16:19:04.554 +08:00] [INFO] [server.go:858] ["PD server config is updated"] [new="{\"use-region-storage\":\"true\",\"max-gap-reset-ts\":\"24h0m0s\",\"key-type\":\"table\",\"runtime-services\":\"\",\"metric-storage\":\"\",\"dashboard-address\":\"http://localhost:2379\",\"trace-region-flow\":\"true\"}"] [old="{\"use-region-storage\":\"true\",\"max-gap-reset-ts\":\"24h0m0s\",\"key-type\":\"table\",\"runtime-services\":\"\",\"metric-storage\":\"\",\"dashboard-address\":\"http://10.0.23.47:2379\",\"trace-region-flow\":\"true\"}"]
[2021/06/10 16:19:05.557 +08:00] [INFO] [dbstore.go:44] ["Dashboard initializing local storage file"] [path=/usr/local/tidb/tidb-v4.0.11-linux-amd64/bin/pd1/dashboard.sqlite.db]
[2021/06/10 16:19:05.563 +08:00] [INFO] [proxy.go:199] ["start serve requests to remotes"] [endpoint=127.0.0.1:37983] [remotes="[]"]
[2021/06/10 16:19:05.563 +08:00] [INFO] [proxy.go:199] ["start serve requests to remotes"] [endpoint=127.0.0.1:36846] [remotes="[]"]
[2021/06/10 16:19:05.563 +08:00] [INFO] [version.go:41] ["TiDB Dashboard started"] [internal-version=2021.01.04.1] [standalone=No] [pd-version=v4.0.11] [build-time="2021-02-25 04:39:45"] [build-git-hash=41a0a3a87e75]
[2021/06/10 16:19:05.563 +08:00] [INFO] [manager.go:200] ["Dashboard server is started"]
[2021/06/10 16:19:05.564 +08:00] [INFO] [dynamic_config_manager.go:176] ["Load dynamic config from etcd"] [json="{\"keyvisual\":{\"auto_collection_disabled\":false,\"policy\":\"db\",\"policy_kv_separator\":\"\"},\"profiling\":{\"auto_collection_targets\":null,\"auto_collection_duration_secs\":0,\"auto_collection_interval_secs\":0}}"]
[2021/06/10 16:19:05.566 +08:00] [INFO] [dynamic_config_manager.go:197] ["Save dynamic config to etcd"] [json="{\"keyvisual\":{\"auto_collection_disabled\":false,\"policy\":\"db\",\"policy_kv_separator\":\"\"},\"profiling\":{\"auto_collection_targets\":null,\"auto_collection_duration_secs\":0,\"auto_collection_interval_secs\":0}}"]
[2021/06/10 16:19:05.651 +08:00] [INFO] [manager.go:85] ["Key visual service is started"]
[2021/06/10 16:20:05.569 +08:00] [WARN] [tidb_requests.go:47] ["failed to get tidb schema version"] []
[2021/06/10 16:21:05.569 +08:00] [WARN] [tidb_requests.go:47] ["failed to get tidb schema version"] []
[2021/06/10 16:22:05.568 +08:00] [WARN] [tidb_requests.go:47] ["failed to get tidb schema version"] []
[2021/06/10 16:23:05.568 +08:00] [WARN] [tidb_requests.go:47] ["failed to get tidb schema version"] []
Orion7r commented 3 years ago

Because we prioritized PostgreSQL compatible system tables when we were compatible with PostgreSQL, we changed the names of some of the system tables in the INFORMATION_SCHEMA library of the original TIDB. To avoid having a table with the same name as the PostgreSQL system library in this library, we will fix this bug later. XD