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

executor: fix TempDir permissions bug (#16823) #16996

Merged
merged 3 commits into from
May 7, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented May 6, 2020

cherry-pick #16823 to release-4.0


Signed-off-by: Qiannan Lyu [email protected]

What problem does this PR solve?

Issue Number: close #16694

Problem Summary:

What is changed and how it works?

What's Changed: Changed the default oom use temp storage directory.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:

Check List

Tests

  • Manual test (add detailed scripts or steps below)

run tidb under current user.

➜  tidb git:(bugfix-executor-16694) ./bin/tidb-server 
....
[2020/04/26 13:19:59.923 +12:00] [INFO] [delete_range.go:133] ["[ddl] start delRange emulator"]
[2020/04/26 13:19:59.929 +12:00] [INFO] [domain.go:144] ["full load InfoSchema success"] [usedSchemaVersion=0] [neededSchemaVersion=22] ["start time"=5.210194ms]
[2020/04/26 13:19:59.929 +12:00] [INFO] [domain.go:368] ["full load and reset schema validator"]
[2020/04/26 13:19:59.953 +12:00] [INFO] [server.go:235] ["server is running MySQL protocol"] [addr=0.0.0.0:4000]
[2020/04/26 13:19:59.953 +12:00] [INFO] [http_status.go:81] ["for status and metrics report"] ["listening on addr"=0.0.0.0:10080]
[2020/04/26 13:19:59.954 +12:00] [INFO] [domain.go:1044] ["init stats info time"] ["take time"=1.085873ms]

Fail to run again by the same user.

➜  tidb git:(bugfix-executor-16694) ./bin/tidb-server 
The current temporary storage dir(/var/folders/sy/0hb_gmbx087c36vy31vj398h0000gn/T/501_tidb/NDAwMC8xMDA4MA==/tmp-storage) has been occupied by another instance, check tmp-storage-path config and make sure they are different.%   

Change to another user

➜  tidb git:(bugfix-executor-16694) su - mina            
Password:
mina@Qiannan-MBP tidb % ./bin/tidb-server
[2020/04/26 13:25:35.069 +12:00] [INFO] [printer.go:41] ["Welcome to TiDB."] ["Release Version"=v4.0.0-beta.2-353-g6c951dd79] ["Git Commit Hash"=6c951dd792786193c1e596868193c49e3ee13de2] ["Git Branch"=bugfix-executor-16694] ["UTC Build Time"="2020-04-26 01:19:36"] [GoVersion=go1.13.5] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiKV Min Version"=v3.0.0-60965b006877ca7234adaced7890d7b029ed1306]
[2020/04/26 13:25:35.070 +12:00] [INFO] [printer.go:54] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"0.0.0.0\",\"port\":4000,\"cors\":\"\",\"store\":\"mocktikv\",\"path\":\"/tmp/tidb\",\"socket\":\"\",\"lease\":\"45s\",\"run-ddl\":true,\"split-table\":true,\"token-limit\":1000,\"oom-use-tmp-storage\":true,\"tmp-storage-path\":\"/tmp/502_tidb/NDAwMC8xMDA4MA==/tmp-storage\",\"oom-action\":\"cancel\",\"mem-quota-query\":1073741824,\"tmp-storage-quota\":-1,\"enable-streaming\":false,\"enable-batch-dml\":false,\"lower-case-table-names\":2,\"server-version\":\"\",\"log\":{\"level\":\"info\",\"format\":\"text\",\"disable-timestamp\":null,\"enable-timestamp\":null,\"disable-error-stack\":null,\"enable-error-stack\":null,\"file\":{\"filename\":\"\",\"max-size\":300,\"max-days\":0,\"max-backups\":0},\"enable-slow-log\":true,\"slow-query-file\":\"tidb-slow.log\",\"slow-threshold\":300,\"expensive-threshold\":10000,\"query-log-max-len\":4096,\"record-plan-in-slow-log\":1},\"security\":{\"skip-grant-table\":false,\"ssl-ca\":\"\",\"ssl-cert\":\"\",\"ssl-key\":\"\",\"require-secure-transport\":false,\"cluster-ssl-ca\":\"\",\"cluster-ssl-cert\":\"\",\"cluster-ssl-key\":\"\",\"cluster-verify-cn\":null},\"status\":{\"status-host\":\"0.0.0.0\",\"metrics-addr\":\"\",\"status-port\":10080,\"metrics-interval\":15,\"report-status\":true,\"record-db-qps\":false},\"performance\":{\"max-procs\":0,\"max-memory\":0,\"stats-lease\":\"3s\",\"stmt-count-limit\":5000,\"feedback-probability\":0.05,\"query-feedback-limit\":1024,\"pseudo-estimate-ratio\":0.8,\"force-priority\":\"NO_PRIORITY\",\"bind-info-lease\":\"3s\",\"txn-total-size-limit\":104857600,\"tcp-keep-alive\":true,\"cross-join\":true,\"run-auto-analyze\":true,\"agg-push-down-join\":false,\"committer-concurrency\":16,\"max-txn-ttl\":600000},\"prepared-plan-cache\":{\"enabled\":false,\"capacity\":100,\"memory-guard-ratio\":0.1},\"opentracing\":{\"enable\":false,\"rpc-metrics\":false,\"sampler\":{\"type\":\"const\",\"param\":1,\"sampling-server-url\":\"\",\"max-operations\":0,\"sampling-refresh-interval\":0},\"reporter\":{\"queue-size\":0,\"buffer-flush-interval\":0,\"log-spans\":false,\"local-agent-host-port\":\"\"}},\"proxy-protocol\":{\"networks\":\"\",\"header-timeout\":5},\"tikv-client\":{\"grpc-connection-count\":4,\"grpc-keepalive-time\":10,\"grpc-keepalive-timeout\":3,\"commit-timeout\":\"41s\",\"max-batch-size\":128,\"overload-threshold\":200,\"max-batch-wait-time\":0,\"batch-wait-size\":8,\"enable-chunk-rpc\":true,\"region-cache-ttl\":600,\"store-limit\":0,\"copr-cache\":{\"enabled\":true,\"capacity-mb\":1000,\"admission-max-result-mb\":10,\"admission-min-process-ms\":5}},\"binlog\":{\"enable\":false,\"ignore-error\":false,\"write-timeout\":\"15s\",\"binlog-socket\":\"\",\"strategy\":\"range\"},\"compatible-kill-query\":false,\"plugin\":{\"dir\":\"\",\"load\":\"\"},\"pessimistic-txn\":{\"enable\":true,\"max-retry-count\":256},\"check-mb4-value-in-utf8\":true,\"max-index-length\":3072,\"alter-primary-key\":false,\"treat-old-version-utf8-as-utf8mb4\":true,\"enable-table-lock\":false,\"delay-clean-table-lock\":0,\"split-region-max-num\":1000,\"stmt-summary\":{\"enable\":true,\"enable-internal-query\":false,\"max-stmt-count\":200,\"max-sql-length\":4096,\"refresh-interval\":1800,\"history-size\":24},\"repair-mode\":false,\"repair-table-list\":[],\"isolation-read\":{\"engines\":[\"tikv\",\"tiflash\",\"tidb\"]},\"max-server-connections\":0,\"new_collations_enabled_on_first_bootstrap\":false,\"experimental\":{\"allow-auto-random\":false,\"allow-expression-index\":false},\"enable-collect-execution-info\":false}"]
[2020/04/26 13:25:35.070 +12:00] [INFO] [main.go:341] ["disable Prometheus push client"]
[2020/04/26 13:25:35.070 +12:00] [INFO] [store.go:68] ["new store"] [path=mocktikv:///tmp/tidb]
[2020/04/26 13:25:35.070 +12:00] [INFO] [systime_mon.go:25] ["start system time monitor"]

Release note

  • No release note

@sre-bot sre-bot requested a review from a team as a code owner May 6, 2020 12:47
@sre-bot
Copy link
Contributor Author

sre-bot commented May 6, 2020

/run-all-tests

@ghost ghost requested a review from XuHuaiyu May 6, 2020 12:47
@sre-bot sre-bot added component/config sig/execution SIG execution contribution This PR is from a community contributor. type/4.0-cherry-pick labels May 6, 2020
@sre-bot sre-bot added this to the v4.0.0-rc.1 milestone May 6, 2020
@SunRunAway
Copy link
Contributor

/run-all-tests

@zyxbest
Copy link
Contributor

zyxbest commented May 7, 2020

/build

@SunRunAway
Copy link
Contributor

/rebuild

@SunRunAway

This comment has been minimized.

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 7, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented May 7, 2020

/run-all-tests

@SunRunAway SunRunAway removed the status/can-merge Indicates a PR has been approved by a committer. label May 7, 2020
Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway SunRunAway added status/LGT1 Indicates that a PR has LGTM 1. status/all-tests-passed labels May 7, 2020
Copy link
Contributor

@HunDunDM HunDunDM left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 7, 2020
@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label May 7, 2020
@zz-jason zz-jason removed request for XuHuaiyu and wshwsh12 May 7, 2020 10:50
@sre-bot
Copy link
Contributor Author

sre-bot commented May 7, 2020

/run-all-tests

@sre-bot sre-bot merged commit 6b6096f into pingcap:release-4.0 May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config contribution This PR is from a community contributor. sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants