Commit 9afb5a0
Log Thrift requests to Perf Schema
Summary:
Add instrumentation to log thrift request from bypass rpc workflow to performance schema (specifically the "esms_by_all" table). The changes made include:
- adding a sysvar to control pfs logging (this is enabled by default)
- adding statement/digest instrumentation to Bypass RPC path
- computing the query's digest if the sysvar is enabled (needed to log to performance schema)
Differential Revision: D46087826
-------------------------------------------------------------------------------------
Do not define static variables in a header file (facebook#1409)
Summary:
Since they are used only once, move them to their respective use locations. This fixes a GCC compilation error:
In file included from /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/rdb_nosql_digest.cc:1: /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:28:20: error: ‘myrocks::desc_tok’ defined but not used [-Werror=unused-variable]
28 | static LEX_CSTRING desc_tok{STRING_WITH_LEN("DESC")};
| ^~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:27:20: error: ‘myrocks::asc_tok’ defined but not used [-Werror=unused-variable]
27 | static LEX_CSTRING asc_tok{STRING_WITH_LEN("ASC")};
| ^~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:26:20: error: ‘myrocks::limit_tok’ defined but not used [-Werror=unused-variable]
26 | static LEX_CSTRING limit_tok{STRING_WITH_LEN("LIMIT")};
| ^~~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:25:20: error: ‘myrocks::by_tok’ defined but not used [-Werror=unused-variable]
25 | static LEX_CSTRING by_tok{STRING_WITH_LEN("BY")};
| ^~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:24:20: error: ‘myrocks::order_tok’ defined but not used [-Werror=unused-variable]
24 | static LEX_CSTRING order_tok{STRING_WITH_LEN("ORDER")};
| ^~~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:23:20: error: ‘myrocks::index_tok’ defined but not used [-Werror=unused-variable]
23 | static LEX_CSTRING index_tok{STRING_WITH_LEN("INDEX")};
| ^~~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:22:20: error: ‘myrocks::force_tok’ defined but not used [-Werror=unused-variable]
22 | static LEX_CSTRING force_tok{STRING_WITH_LEN("FORCE")};
| ^~~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:21:20: error: ‘myrocks::where_tok’ defined but not used [-Werror=unused-variable]
21 | static LEX_CSTRING where_tok{STRING_WITH_LEN("WHERE")};
| ^~~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:20:20: error: ‘myrocks::from_tok’ defined but not used [-Werror=unused-variable]
20 | static LEX_CSTRING from_tok{STRING_WITH_LEN("FROM")};
| ^~~~~~~~
/home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:19:20: error: ‘myrocks::select_tok’ defined but not used [-Werror=unused-variable]
19 | static LEX_CSTRING select_tok{STRING_WITH_LEN("SELECT")};
| ^~~~~~~~~~
Pull Request resolved: facebook#1409
Differential Revision: D52259043
fbshipit-source-id: 42a062a
------------------------------------------------------------------------------------
[thrift] Fix bypass_pfs_logging test
Summary:
Fixed failing tests and other bugs that showed up while attempting to
reproduce the issue
- update digest from test results; this is likely from recording test
results on an older iteration
- set `thrift_server_bypass` to ON in thrift_server test initialization
(this is needed after D52489280 sets this to `OFF` by default)
- clean up state of `bypass_pfs_logging` sys var after tests
Differential Revision: D52523295
fbshipit-source-id: eb5a1f81 parent f88f19c commit 9afb5a0
File tree
15 files changed
+654
-2
lines changed- mysql-test
- r
- suite
- sys_vars
- r
- t
- thrift_server
- include
- r
- t
- sql
- storage/rocksdb
15 files changed
+654
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
3225 | 3228 | | |
3226 | 3229 | | |
3227 | 3230 | | |
| 3231 | + | |
3228 | 3232 | | |
3229 | 3233 | | |
3230 | 3234 | | |
| |||
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Lines changed: 119 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
0 commit comments