feat: add drop dnode unsafe command
This commit is contained in:
parent
72c543563f
commit
cf7b4593e7
|
@ -1629,6 +1629,7 @@ typedef struct {
|
||||||
char fqdn[TSDB_FQDN_LEN];
|
char fqdn[TSDB_FQDN_LEN];
|
||||||
int32_t port;
|
int32_t port;
|
||||||
int8_t force;
|
int8_t force;
|
||||||
|
int8_t unsafe;
|
||||||
} SDropDnodeReq;
|
} SDropDnodeReq;
|
||||||
|
|
||||||
int32_t tSerializeSDropDnodeReq(void* buf, int32_t bufLen, SDropDnodeReq* pReq);
|
int32_t tSerializeSDropDnodeReq(void* buf, int32_t bufLen, SDropDnodeReq* pReq);
|
||||||
|
|
|
@ -70,286 +70,288 @@
|
||||||
#define TK_RESTORE 52
|
#define TK_RESTORE 52
|
||||||
#define TK_NK_IPTOKEN 53
|
#define TK_NK_IPTOKEN 53
|
||||||
#define TK_FORCE 54
|
#define TK_FORCE 54
|
||||||
#define TK_LOCAL 55
|
#define TK_UNSAFE 55
|
||||||
#define TK_QNODE 56
|
#define TK_LOCAL 56
|
||||||
#define TK_BNODE 57
|
#define TK_QNODE 57
|
||||||
#define TK_SNODE 58
|
#define TK_BNODE 58
|
||||||
#define TK_MNODE 59
|
#define TK_SNODE 59
|
||||||
#define TK_VNODE 60
|
#define TK_MNODE 60
|
||||||
#define TK_DATABASE 61
|
#define TK_VNODE 61
|
||||||
#define TK_USE 62
|
#define TK_DATABASE 62
|
||||||
#define TK_FLUSH 63
|
#define TK_USE 63
|
||||||
#define TK_TRIM 64
|
#define TK_FLUSH 64
|
||||||
#define TK_COMPACT 65
|
#define TK_TRIM 65
|
||||||
#define TK_IF 66
|
#define TK_COMPACT 66
|
||||||
#define TK_NOT 67
|
#define TK_IF 67
|
||||||
#define TK_EXISTS 68
|
#define TK_NOT 68
|
||||||
#define TK_BUFFER 69
|
#define TK_EXISTS 69
|
||||||
#define TK_CACHEMODEL 70
|
#define TK_BUFFER 70
|
||||||
#define TK_CACHESIZE 71
|
#define TK_CACHEMODEL 71
|
||||||
#define TK_COMP 72
|
#define TK_CACHESIZE 72
|
||||||
#define TK_DURATION 73
|
#define TK_COMP 73
|
||||||
#define TK_NK_VARIABLE 74
|
#define TK_DURATION 74
|
||||||
#define TK_MAXROWS 75
|
#define TK_NK_VARIABLE 75
|
||||||
#define TK_MINROWS 76
|
#define TK_MAXROWS 76
|
||||||
#define TK_KEEP 77
|
#define TK_MINROWS 77
|
||||||
#define TK_PAGES 78
|
#define TK_KEEP 78
|
||||||
#define TK_PAGESIZE 79
|
#define TK_PAGES 79
|
||||||
#define TK_TSDB_PAGESIZE 80
|
#define TK_PAGESIZE 80
|
||||||
#define TK_PRECISION 81
|
#define TK_TSDB_PAGESIZE 81
|
||||||
#define TK_REPLICA 82
|
#define TK_PRECISION 82
|
||||||
#define TK_VGROUPS 83
|
#define TK_REPLICA 83
|
||||||
#define TK_SINGLE_STABLE 84
|
#define TK_VGROUPS 84
|
||||||
#define TK_RETENTIONS 85
|
#define TK_SINGLE_STABLE 85
|
||||||
#define TK_SCHEMALESS 86
|
#define TK_RETENTIONS 86
|
||||||
#define TK_WAL_LEVEL 87
|
#define TK_SCHEMALESS 87
|
||||||
#define TK_WAL_FSYNC_PERIOD 88
|
#define TK_WAL_LEVEL 88
|
||||||
#define TK_WAL_RETENTION_PERIOD 89
|
#define TK_WAL_FSYNC_PERIOD 89
|
||||||
#define TK_WAL_RETENTION_SIZE 90
|
#define TK_WAL_RETENTION_PERIOD 90
|
||||||
#define TK_WAL_ROLL_PERIOD 91
|
#define TK_WAL_RETENTION_SIZE 91
|
||||||
#define TK_WAL_SEGMENT_SIZE 92
|
#define TK_WAL_ROLL_PERIOD 92
|
||||||
#define TK_STT_TRIGGER 93
|
#define TK_WAL_SEGMENT_SIZE 93
|
||||||
#define TK_TABLE_PREFIX 94
|
#define TK_STT_TRIGGER 94
|
||||||
#define TK_TABLE_SUFFIX 95
|
#define TK_TABLE_PREFIX 95
|
||||||
#define TK_NK_COLON 96
|
#define TK_TABLE_SUFFIX 96
|
||||||
#define TK_MAX_SPEED 97
|
#define TK_NK_COLON 97
|
||||||
#define TK_START 98
|
#define TK_MAX_SPEED 98
|
||||||
#define TK_TIMESTAMP 99
|
#define TK_START 99
|
||||||
#define TK_END 100
|
#define TK_TIMESTAMP 100
|
||||||
#define TK_TABLE 101
|
#define TK_END 101
|
||||||
#define TK_NK_LP 102
|
#define TK_TABLE 102
|
||||||
#define TK_NK_RP 103
|
#define TK_NK_LP 103
|
||||||
#define TK_STABLE 104
|
#define TK_NK_RP 104
|
||||||
#define TK_ADD 105
|
#define TK_STABLE 105
|
||||||
#define TK_COLUMN 106
|
#define TK_ADD 106
|
||||||
#define TK_MODIFY 107
|
#define TK_COLUMN 107
|
||||||
#define TK_RENAME 108
|
#define TK_MODIFY 108
|
||||||
#define TK_TAG 109
|
#define TK_RENAME 109
|
||||||
#define TK_SET 110
|
#define TK_TAG 110
|
||||||
#define TK_NK_EQ 111
|
#define TK_SET 111
|
||||||
#define TK_USING 112
|
#define TK_NK_EQ 112
|
||||||
#define TK_TAGS 113
|
#define TK_USING 113
|
||||||
#define TK_BOOL 114
|
#define TK_TAGS 114
|
||||||
#define TK_TINYINT 115
|
#define TK_BOOL 115
|
||||||
#define TK_SMALLINT 116
|
#define TK_TINYINT 116
|
||||||
#define TK_INT 117
|
#define TK_SMALLINT 117
|
||||||
#define TK_INTEGER 118
|
#define TK_INT 118
|
||||||
#define TK_BIGINT 119
|
#define TK_INTEGER 119
|
||||||
#define TK_FLOAT 120
|
#define TK_BIGINT 120
|
||||||
#define TK_DOUBLE 121
|
#define TK_FLOAT 121
|
||||||
#define TK_BINARY 122
|
#define TK_DOUBLE 122
|
||||||
#define TK_NCHAR 123
|
#define TK_BINARY 123
|
||||||
#define TK_UNSIGNED 124
|
#define TK_NCHAR 124
|
||||||
#define TK_JSON 125
|
#define TK_UNSIGNED 125
|
||||||
#define TK_VARCHAR 126
|
#define TK_JSON 126
|
||||||
#define TK_MEDIUMBLOB 127
|
#define TK_VARCHAR 127
|
||||||
#define TK_BLOB 128
|
#define TK_MEDIUMBLOB 128
|
||||||
#define TK_VARBINARY 129
|
#define TK_BLOB 129
|
||||||
#define TK_DECIMAL 130
|
#define TK_VARBINARY 130
|
||||||
#define TK_COMMENT 131
|
#define TK_DECIMAL 131
|
||||||
#define TK_MAX_DELAY 132
|
#define TK_COMMENT 132
|
||||||
#define TK_WATERMARK 133
|
#define TK_MAX_DELAY 133
|
||||||
#define TK_ROLLUP 134
|
#define TK_WATERMARK 134
|
||||||
#define TK_TTL 135
|
#define TK_ROLLUP 135
|
||||||
#define TK_SMA 136
|
#define TK_TTL 136
|
||||||
#define TK_DELETE_MARK 137
|
#define TK_SMA 137
|
||||||
#define TK_FIRST 138
|
#define TK_DELETE_MARK 138
|
||||||
#define TK_LAST 139
|
#define TK_FIRST 139
|
||||||
#define TK_SHOW 140
|
#define TK_LAST 140
|
||||||
#define TK_PRIVILEGES 141
|
#define TK_SHOW 141
|
||||||
#define TK_DATABASES 142
|
#define TK_PRIVILEGES 142
|
||||||
#define TK_TABLES 143
|
#define TK_DATABASES 143
|
||||||
#define TK_STABLES 144
|
#define TK_TABLES 144
|
||||||
#define TK_MNODES 145
|
#define TK_STABLES 145
|
||||||
#define TK_QNODES 146
|
#define TK_MNODES 146
|
||||||
#define TK_FUNCTIONS 147
|
#define TK_QNODES 147
|
||||||
#define TK_INDEXES 148
|
#define TK_FUNCTIONS 148
|
||||||
#define TK_ACCOUNTS 149
|
#define TK_INDEXES 149
|
||||||
#define TK_APPS 150
|
#define TK_ACCOUNTS 150
|
||||||
#define TK_CONNECTIONS 151
|
#define TK_APPS 151
|
||||||
#define TK_LICENCES 152
|
#define TK_CONNECTIONS 152
|
||||||
#define TK_GRANTS 153
|
#define TK_LICENCES 153
|
||||||
#define TK_QUERIES 154
|
#define TK_GRANTS 154
|
||||||
#define TK_SCORES 155
|
#define TK_QUERIES 155
|
||||||
#define TK_TOPICS 156
|
#define TK_SCORES 156
|
||||||
#define TK_VARIABLES 157
|
#define TK_TOPICS 157
|
||||||
#define TK_CLUSTER 158
|
#define TK_VARIABLES 158
|
||||||
#define TK_BNODES 159
|
#define TK_CLUSTER 159
|
||||||
#define TK_SNODES 160
|
#define TK_BNODES 160
|
||||||
#define TK_TRANSACTIONS 161
|
#define TK_SNODES 161
|
||||||
#define TK_DISTRIBUTED 162
|
#define TK_TRANSACTIONS 162
|
||||||
#define TK_CONSUMERS 163
|
#define TK_DISTRIBUTED 163
|
||||||
#define TK_SUBSCRIPTIONS 164
|
#define TK_CONSUMERS 164
|
||||||
#define TK_VNODES 165
|
#define TK_SUBSCRIPTIONS 165
|
||||||
#define TK_ALIVE 166
|
#define TK_VNODES 166
|
||||||
#define TK_LIKE 167
|
#define TK_ALIVE 167
|
||||||
#define TK_TBNAME 168
|
#define TK_LIKE 168
|
||||||
#define TK_QTAGS 169
|
#define TK_TBNAME 169
|
||||||
#define TK_AS 170
|
#define TK_QTAGS 170
|
||||||
#define TK_INDEX 171
|
#define TK_AS 171
|
||||||
#define TK_FUNCTION 172
|
#define TK_INDEX 172
|
||||||
#define TK_INTERVAL 173
|
#define TK_FUNCTION 173
|
||||||
#define TK_COUNT 174
|
#define TK_INTERVAL 174
|
||||||
#define TK_LAST_ROW 175
|
#define TK_COUNT 175
|
||||||
#define TK_TOPIC 176
|
#define TK_LAST_ROW 176
|
||||||
#define TK_META 177
|
#define TK_TOPIC 177
|
||||||
#define TK_CONSUMER 178
|
#define TK_META 178
|
||||||
#define TK_GROUP 179
|
#define TK_CONSUMER 179
|
||||||
#define TK_DESC 180
|
#define TK_GROUP 180
|
||||||
#define TK_DESCRIBE 181
|
#define TK_DESC 181
|
||||||
#define TK_RESET 182
|
#define TK_DESCRIBE 182
|
||||||
#define TK_QUERY 183
|
#define TK_RESET 183
|
||||||
#define TK_CACHE 184
|
#define TK_QUERY 184
|
||||||
#define TK_EXPLAIN 185
|
#define TK_CACHE 185
|
||||||
#define TK_ANALYZE 186
|
#define TK_EXPLAIN 186
|
||||||
#define TK_VERBOSE 187
|
#define TK_ANALYZE 187
|
||||||
#define TK_NK_BOOL 188
|
#define TK_VERBOSE 188
|
||||||
#define TK_RATIO 189
|
#define TK_NK_BOOL 189
|
||||||
#define TK_NK_FLOAT 190
|
#define TK_RATIO 190
|
||||||
#define TK_OUTPUTTYPE 191
|
#define TK_NK_FLOAT 191
|
||||||
#define TK_AGGREGATE 192
|
#define TK_OUTPUTTYPE 192
|
||||||
#define TK_BUFSIZE 193
|
#define TK_AGGREGATE 193
|
||||||
#define TK_LANGUAGE 194
|
#define TK_BUFSIZE 194
|
||||||
#define TK_REPLACE 195
|
#define TK_LANGUAGE 195
|
||||||
#define TK_STREAM 196
|
#define TK_REPLACE 196
|
||||||
#define TK_INTO 197
|
#define TK_STREAM 197
|
||||||
#define TK_PAUSE 198
|
#define TK_INTO 198
|
||||||
#define TK_RESUME 199
|
#define TK_PAUSE 199
|
||||||
#define TK_TRIGGER 200
|
#define TK_RESUME 200
|
||||||
#define TK_AT_ONCE 201
|
#define TK_TRIGGER 201
|
||||||
#define TK_WINDOW_CLOSE 202
|
#define TK_AT_ONCE 202
|
||||||
#define TK_IGNORE 203
|
#define TK_WINDOW_CLOSE 203
|
||||||
#define TK_EXPIRED 204
|
#define TK_IGNORE 204
|
||||||
#define TK_FILL_HISTORY 205
|
#define TK_EXPIRED 205
|
||||||
#define TK_UPDATE 206
|
#define TK_FILL_HISTORY 206
|
||||||
#define TK_SUBTABLE 207
|
#define TK_UPDATE 207
|
||||||
#define TK_UNTREATED 208
|
#define TK_SUBTABLE 208
|
||||||
#define TK_KILL 209
|
#define TK_UNTREATED 209
|
||||||
#define TK_CONNECTION 210
|
#define TK_KILL 210
|
||||||
#define TK_TRANSACTION 211
|
#define TK_CONNECTION 211
|
||||||
#define TK_BALANCE 212
|
#define TK_TRANSACTION 212
|
||||||
#define TK_VGROUP 213
|
#define TK_BALANCE 213
|
||||||
#define TK_LEADER 214
|
#define TK_VGROUP 214
|
||||||
#define TK_MERGE 215
|
#define TK_LEADER 215
|
||||||
#define TK_REDISTRIBUTE 216
|
#define TK_MERGE 216
|
||||||
#define TK_SPLIT 217
|
#define TK_REDISTRIBUTE 217
|
||||||
#define TK_DELETE 218
|
#define TK_SPLIT 218
|
||||||
#define TK_INSERT 219
|
#define TK_DELETE 219
|
||||||
#define TK_NULL 220
|
#define TK_INSERT 220
|
||||||
#define TK_NK_QUESTION 221
|
#define TK_NULL 221
|
||||||
#define TK_NK_ARROW 222
|
#define TK_NK_QUESTION 222
|
||||||
#define TK_ROWTS 223
|
#define TK_NK_ARROW 223
|
||||||
#define TK_QSTART 224
|
#define TK_ROWTS 224
|
||||||
#define TK_QEND 225
|
#define TK_QSTART 225
|
||||||
#define TK_QDURATION 226
|
#define TK_QEND 226
|
||||||
#define TK_WSTART 227
|
#define TK_QDURATION 227
|
||||||
#define TK_WEND 228
|
#define TK_WSTART 228
|
||||||
#define TK_WDURATION 229
|
#define TK_WEND 229
|
||||||
#define TK_IROWTS 230
|
#define TK_WDURATION 230
|
||||||
#define TK_ISFILLED 231
|
#define TK_IROWTS 231
|
||||||
#define TK_CAST 232
|
#define TK_ISFILLED 232
|
||||||
#define TK_NOW 233
|
#define TK_CAST 233
|
||||||
#define TK_TODAY 234
|
#define TK_NOW 234
|
||||||
#define TK_TIMEZONE 235
|
#define TK_TODAY 235
|
||||||
#define TK_CLIENT_VERSION 236
|
#define TK_TIMEZONE 236
|
||||||
#define TK_SERVER_VERSION 237
|
#define TK_CLIENT_VERSION 237
|
||||||
#define TK_SERVER_STATUS 238
|
#define TK_SERVER_VERSION 238
|
||||||
#define TK_CURRENT_USER 239
|
#define TK_SERVER_STATUS 239
|
||||||
#define TK_CASE 240
|
#define TK_CURRENT_USER 240
|
||||||
#define TK_WHEN 241
|
#define TK_CASE 241
|
||||||
#define TK_THEN 242
|
#define TK_WHEN 242
|
||||||
#define TK_ELSE 243
|
#define TK_THEN 243
|
||||||
#define TK_BETWEEN 244
|
#define TK_ELSE 244
|
||||||
#define TK_IS 245
|
#define TK_BETWEEN 245
|
||||||
#define TK_NK_LT 246
|
#define TK_IS 246
|
||||||
#define TK_NK_GT 247
|
#define TK_NK_LT 247
|
||||||
#define TK_NK_LE 248
|
#define TK_NK_GT 248
|
||||||
#define TK_NK_GE 249
|
#define TK_NK_LE 249
|
||||||
#define TK_NK_NE 250
|
#define TK_NK_GE 250
|
||||||
#define TK_MATCH 251
|
#define TK_NK_NE 251
|
||||||
#define TK_NMATCH 252
|
#define TK_MATCH 252
|
||||||
#define TK_CONTAINS 253
|
#define TK_NMATCH 253
|
||||||
#define TK_IN 254
|
#define TK_CONTAINS 254
|
||||||
#define TK_JOIN 255
|
#define TK_IN 255
|
||||||
#define TK_INNER 256
|
#define TK_JOIN 256
|
||||||
#define TK_SELECT 257
|
#define TK_INNER 257
|
||||||
#define TK_DISTINCT 258
|
#define TK_SELECT 258
|
||||||
#define TK_WHERE 259
|
#define TK_DISTINCT 259
|
||||||
#define TK_PARTITION 260
|
#define TK_WHERE 260
|
||||||
#define TK_BY 261
|
#define TK_PARTITION 261
|
||||||
#define TK_SESSION 262
|
#define TK_BY 262
|
||||||
#define TK_STATE_WINDOW 263
|
#define TK_SESSION 263
|
||||||
#define TK_EVENT_WINDOW 264
|
#define TK_STATE_WINDOW 264
|
||||||
#define TK_SLIDING 265
|
#define TK_EVENT_WINDOW 265
|
||||||
#define TK_FILL 266
|
#define TK_SLIDING 266
|
||||||
#define TK_VALUE 267
|
#define TK_FILL 267
|
||||||
#define TK_VALUE_F 268
|
#define TK_VALUE 268
|
||||||
#define TK_NONE 269
|
#define TK_VALUE_F 269
|
||||||
#define TK_PREV 270
|
#define TK_NONE 270
|
||||||
#define TK_NULL_F 271
|
#define TK_PREV 271
|
||||||
#define TK_LINEAR 272
|
#define TK_NULL_F 272
|
||||||
#define TK_NEXT 273
|
#define TK_LINEAR 273
|
||||||
#define TK_HAVING 274
|
#define TK_NEXT 274
|
||||||
#define TK_RANGE 275
|
#define TK_HAVING 275
|
||||||
#define TK_EVERY 276
|
#define TK_RANGE 276
|
||||||
#define TK_ORDER 277
|
#define TK_EVERY 277
|
||||||
#define TK_SLIMIT 278
|
#define TK_ORDER 278
|
||||||
#define TK_SOFFSET 279
|
#define TK_SLIMIT 279
|
||||||
#define TK_LIMIT 280
|
#define TK_SOFFSET 280
|
||||||
#define TK_OFFSET 281
|
#define TK_LIMIT 281
|
||||||
#define TK_ASC 282
|
#define TK_OFFSET 282
|
||||||
#define TK_NULLS 283
|
#define TK_ASC 283
|
||||||
#define TK_ABORT 284
|
#define TK_NULLS 284
|
||||||
#define TK_AFTER 285
|
#define TK_ABORT 285
|
||||||
#define TK_ATTACH 286
|
#define TK_AFTER 286
|
||||||
#define TK_BEFORE 287
|
#define TK_ATTACH 287
|
||||||
#define TK_BEGIN 288
|
#define TK_BEFORE 288
|
||||||
#define TK_BITAND 289
|
#define TK_BEGIN 289
|
||||||
#define TK_BITNOT 290
|
#define TK_BITAND 290
|
||||||
#define TK_BITOR 291
|
#define TK_BITNOT 291
|
||||||
#define TK_BLOCKS 292
|
#define TK_BITOR 292
|
||||||
#define TK_CHANGE 293
|
#define TK_BLOCKS 293
|
||||||
#define TK_COMMA 294
|
#define TK_CHANGE 294
|
||||||
#define TK_CONCAT 295
|
#define TK_COMMA 295
|
||||||
#define TK_CONFLICT 296
|
#define TK_CONCAT 296
|
||||||
#define TK_COPY 297
|
#define TK_CONFLICT 297
|
||||||
#define TK_DEFERRED 298
|
#define TK_COPY 298
|
||||||
#define TK_DELIMITERS 299
|
#define TK_DEFERRED 299
|
||||||
#define TK_DETACH 300
|
#define TK_DELIMITERS 300
|
||||||
#define TK_DIVIDE 301
|
#define TK_DETACH 301
|
||||||
#define TK_DOT 302
|
#define TK_DIVIDE 302
|
||||||
#define TK_EACH 303
|
#define TK_DOT 303
|
||||||
#define TK_FAIL 304
|
#define TK_EACH 304
|
||||||
#define TK_FILE 305
|
#define TK_FAIL 305
|
||||||
#define TK_FOR 306
|
#define TK_FILE 306
|
||||||
#define TK_GLOB 307
|
#define TK_FOR 307
|
||||||
#define TK_ID 308
|
#define TK_GLOB 308
|
||||||
#define TK_IMMEDIATE 309
|
#define TK_ID 309
|
||||||
#define TK_IMPORT 310
|
#define TK_IMMEDIATE 310
|
||||||
#define TK_INITIALLY 311
|
#define TK_IMPORT 311
|
||||||
#define TK_INSTEAD 312
|
#define TK_INITIALLY 312
|
||||||
#define TK_ISNULL 313
|
#define TK_INSTEAD 313
|
||||||
#define TK_KEY 314
|
#define TK_ISNULL 314
|
||||||
#define TK_MODULES 315
|
#define TK_KEY 315
|
||||||
#define TK_NK_BITNOT 316
|
#define TK_MODULES 316
|
||||||
#define TK_NK_SEMI 317
|
#define TK_NK_BITNOT 317
|
||||||
#define TK_NOTNULL 318
|
#define TK_NK_SEMI 318
|
||||||
#define TK_OF 319
|
#define TK_NOTNULL 319
|
||||||
#define TK_PLUS 320
|
#define TK_OF 320
|
||||||
#define TK_PRIVILEGE 321
|
#define TK_PLUS 321
|
||||||
#define TK_RAISE 322
|
#define TK_PRIVILEGE 322
|
||||||
#define TK_RESTRICT 323
|
#define TK_RAISE 323
|
||||||
#define TK_ROW 324
|
#define TK_RESTRICT 324
|
||||||
#define TK_SEMI 325
|
#define TK_ROW 325
|
||||||
#define TK_STAR 326
|
#define TK_SEMI 326
|
||||||
#define TK_STATEMENT 327
|
#define TK_STAR 327
|
||||||
#define TK_STRICT 328
|
#define TK_STATEMENT 328
|
||||||
#define TK_STRING 329
|
#define TK_STRICT 329
|
||||||
#define TK_TIMES 330
|
#define TK_STRING 330
|
||||||
#define TK_VALUES 331
|
#define TK_TIMES 331
|
||||||
#define TK_VARIABLE 332
|
#define TK_VALUES 332
|
||||||
#define TK_VIEW 333
|
#define TK_VARIABLE 333
|
||||||
#define TK_WAL 334
|
#define TK_VIEW 334
|
||||||
|
#define TK_WAL 335
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define TK_NK_SPACE 600
|
#define TK_NK_SPACE 600
|
||||||
|
|
|
@ -249,6 +249,7 @@ typedef struct SDropDnodeStmt {
|
||||||
char fqdn[TSDB_FQDN_LEN];
|
char fqdn[TSDB_FQDN_LEN];
|
||||||
int32_t port;
|
int32_t port;
|
||||||
bool force;
|
bool force;
|
||||||
|
bool unsafe;
|
||||||
} SDropDnodeStmt;
|
} SDropDnodeStmt;
|
||||||
|
|
||||||
typedef struct SAlterDnodeStmt {
|
typedef struct SAlterDnodeStmt {
|
||||||
|
|
|
@ -1701,6 +1701,7 @@ int32_t tSerializeSDropDnodeReq(void *buf, int32_t bufLen, SDropDnodeReq *pReq)
|
||||||
if (tEncodeCStr(&encoder, pReq->fqdn) < 0) return -1;
|
if (tEncodeCStr(&encoder, pReq->fqdn) < 0) return -1;
|
||||||
if (tEncodeI32(&encoder, pReq->port) < 0) return -1;
|
if (tEncodeI32(&encoder, pReq->port) < 0) return -1;
|
||||||
if (tEncodeI8(&encoder, pReq->force) < 0) return -1;
|
if (tEncodeI8(&encoder, pReq->force) < 0) return -1;
|
||||||
|
if (tEncodeI8(&encoder, pReq->unsafe) < 0) return -1;
|
||||||
tEndEncode(&encoder);
|
tEndEncode(&encoder);
|
||||||
|
|
||||||
int32_t tlen = encoder.pos;
|
int32_t tlen = encoder.pos;
|
||||||
|
@ -1717,6 +1718,7 @@ int32_t tDeserializeSDropDnodeReq(void *buf, int32_t bufLen, SDropDnodeReq *pReq
|
||||||
if (tDecodeCStrTo(&decoder, pReq->fqdn) < 0) return -1;
|
if (tDecodeCStrTo(&decoder, pReq->fqdn) < 0) return -1;
|
||||||
if (tDecodeI32(&decoder, &pReq->port) < 0) return -1;
|
if (tDecodeI32(&decoder, &pReq->port) < 0) return -1;
|
||||||
if (tDecodeI8(&decoder, &pReq->force) < 0) return -1;
|
if (tDecodeI8(&decoder, &pReq->force) < 0) return -1;
|
||||||
|
if (tDecodeI8(&decoder, &pReq->unsafe) < 0) return -1;
|
||||||
tEndDecode(&decoder);
|
tEndDecode(&decoder);
|
||||||
|
|
||||||
tDecoderClear(&decoder);
|
tDecoderClear(&decoder);
|
||||||
|
|
|
@ -5510,6 +5510,7 @@ static const char* jkDropDnodeStmtDnodeId = "DnodeId";
|
||||||
static const char* jkDropDnodeStmtFqdn = "Fqdn";
|
static const char* jkDropDnodeStmtFqdn = "Fqdn";
|
||||||
static const char* jkDropDnodeStmtPort = "Port";
|
static const char* jkDropDnodeStmtPort = "Port";
|
||||||
static const char* jkDropDnodeStmtForce = "Force";
|
static const char* jkDropDnodeStmtForce = "Force";
|
||||||
|
static const char* jkDropDnodeStmtUnsafe = "Unsafe";
|
||||||
|
|
||||||
static int32_t dropDnodeStmtToJson(const void* pObj, SJson* pJson) {
|
static int32_t dropDnodeStmtToJson(const void* pObj, SJson* pJson) {
|
||||||
const SDropDnodeStmt* pNode = (const SDropDnodeStmt*)pObj;
|
const SDropDnodeStmt* pNode = (const SDropDnodeStmt*)pObj;
|
||||||
|
@ -5524,6 +5525,9 @@ static int32_t dropDnodeStmtToJson(const void* pObj, SJson* pJson) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = tjsonAddBoolToObject(pJson, jkDropDnodeStmtForce, pNode->force);
|
code = tjsonAddBoolToObject(pJson, jkDropDnodeStmtForce, pNode->force);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonAddBoolToObject(pJson, jkDropDnodeStmtUnsafe, pNode->unsafe);
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -5541,6 +5545,9 @@ static int32_t jsonToDropDnodeStmt(const SJson* pJson, void* pObj) {
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = tjsonGetBoolValue(pJson, jkDropDnodeStmtForce, &pNode->force);
|
code = tjsonGetBoolValue(pJson, jkDropDnodeStmtForce, &pNode->force);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = tjsonGetBoolValue(pJson, jkDropDnodeStmtUnsafe, &pNode->unsafe);
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const ST
|
||||||
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal);
|
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal);
|
||||||
SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName);
|
SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName);
|
||||||
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
||||||
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force);
|
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force, bool unsafe);
|
||||||
SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
|
SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
|
||||||
SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName);
|
SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName);
|
||||||
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
||||||
|
|
|
@ -126,8 +126,10 @@ with_opt(A) ::= WITH search_condition(B).
|
||||||
/************************************************ create/drop/alter/restore dnode *********************************************/
|
/************************************************ create/drop/alter/restore dnode *********************************************/
|
||||||
cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); }
|
cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); }
|
||||||
cmd ::= CREATE DNODE dnode_endpoint(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); }
|
cmd ::= CREATE DNODE dnode_endpoint(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); }
|
||||||
cmd ::= DROP DNODE NK_INTEGER(A) force_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, B); }
|
cmd ::= DROP DNODE NK_INTEGER(A) force_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, B, false); }
|
||||||
cmd ::= DROP DNODE dnode_endpoint(A) force_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, B); }
|
cmd ::= DROP DNODE dnode_endpoint(A) force_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, B, false); }
|
||||||
|
cmd ::= DROP DNODE NK_INTEGER(A) unsafe_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, false, B); }
|
||||||
|
cmd ::= DROP DNODE dnode_endpoint(A) unsafe_opt(B). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A, false, B); }
|
||||||
cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, NULL); }
|
cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, NULL); }
|
||||||
cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B) NK_STRING(C). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, &C); }
|
cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B) NK_STRING(C). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, &C); }
|
||||||
cmd ::= ALTER ALL DNODES NK_STRING(A). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, NULL); }
|
cmd ::= ALTER ALL DNODES NK_STRING(A). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, NULL); }
|
||||||
|
@ -145,6 +147,10 @@ dnode_endpoint(A) ::= NK_IPTOKEN(B).
|
||||||
force_opt(A) ::= . { A = false; }
|
force_opt(A) ::= . { A = false; }
|
||||||
force_opt(A) ::= FORCE. { A = true; }
|
force_opt(A) ::= FORCE. { A = true; }
|
||||||
|
|
||||||
|
%type unsafe_opt { bool }
|
||||||
|
%destructor unsafe_opt { }
|
||||||
|
unsafe_opt(A) ::= UNSAFE. { A = true; }
|
||||||
|
|
||||||
/************************************************ alter local *********************************************************/
|
/************************************************ alter local *********************************************************/
|
||||||
cmd ::= ALTER LOCAL NK_STRING(A). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, NULL); }
|
cmd ::= ALTER LOCAL NK_STRING(A). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, NULL); }
|
||||||
cmd ::= ALTER LOCAL NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, &B); }
|
cmd ::= ALTER LOCAL NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, &B); }
|
||||||
|
|
|
@ -1576,7 +1576,7 @@ SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force) {
|
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force, bool unsafe) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
SDropDnodeStmt* pStmt = (SDropDnodeStmt*)nodesMakeNode(QUERY_NODE_DROP_DNODE_STMT);
|
SDropDnodeStmt* pStmt = (SDropDnodeStmt*)nodesMakeNode(QUERY_NODE_DROP_DNODE_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
|
@ -1589,6 +1589,7 @@ SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pStmt->force = force;
|
pStmt->force = force;
|
||||||
|
pStmt->unsafe = unsafe;
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,6 +241,7 @@ static SKeyword keywordTable[] = {
|
||||||
{"TSERIES", TK_TSERIES},
|
{"TSERIES", TK_TSERIES},
|
||||||
{"TTL", TK_TTL},
|
{"TTL", TK_TTL},
|
||||||
{"UNION", TK_UNION},
|
{"UNION", TK_UNION},
|
||||||
|
{"UNSAFE", TK_UNSAFE},
|
||||||
{"UNSIGNED", TK_UNSIGNED},
|
{"UNSIGNED", TK_UNSIGNED},
|
||||||
{"UNTREATED", TK_UNTREATED},
|
{"UNTREATED", TK_UNTREATED},
|
||||||
{"UPDATE", TK_UPDATE},
|
{"UPDATE", TK_UPDATE},
|
||||||
|
|
|
@ -5517,6 +5517,7 @@ static int32_t translateDropDnode(STranslateContext* pCxt, SDropDnodeStmt* pStmt
|
||||||
strcpy(dropReq.fqdn, pStmt->fqdn);
|
strcpy(dropReq.fqdn, pStmt->fqdn);
|
||||||
dropReq.port = pStmt->port;
|
dropReq.port = pStmt->port;
|
||||||
dropReq.force = pStmt->force;
|
dropReq.force = pStmt->force;
|
||||||
|
dropReq.unsafe = pStmt->unsafe;
|
||||||
|
|
||||||
return buildCmdMsg(pCxt, TDMT_MND_DROP_DNODE, (FSerializeFunc)tSerializeSDropDnodeReq, &dropReq);
|
return buildCmdMsg(pCxt, TDMT_MND_DROP_DNODE, (FSerializeFunc)tSerializeSDropDnodeReq, &dropReq);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -94,15 +94,17 @@ TEST_F(ParserInitialDTest, dropDnode) {
|
||||||
|
|
||||||
auto clearDropDnodeReq = [&]() { memset(&expect, 0, sizeof(SDropDnodeReq)); };
|
auto clearDropDnodeReq = [&]() { memset(&expect, 0, sizeof(SDropDnodeReq)); };
|
||||||
|
|
||||||
auto setDropDnodeReqById = [&](int32_t dnodeId, bool force = false) {
|
auto setDropDnodeReqById = [&](int32_t dnodeId, bool force = false, bool unsafe = false) {
|
||||||
expect.dnodeId = dnodeId;
|
expect.dnodeId = dnodeId;
|
||||||
expect.force = force;
|
expect.force = force;
|
||||||
|
expect.unsafe = unsafe;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto setDropDnodeReqByEndpoint = [&](const char* pFqdn, int32_t port = tsServerPort, bool force = false) {
|
auto setDropDnodeReqByEndpoint = [&](const char* pFqdn, int32_t port = tsServerPort, bool force = false, bool unsafe = false) {
|
||||||
strcpy(expect.fqdn, pFqdn);
|
strcpy(expect.fqdn, pFqdn);
|
||||||
expect.port = port;
|
expect.port = port;
|
||||||
expect.force = force;
|
expect.force = force;
|
||||||
|
expect.unsafe = unsafe;
|
||||||
};
|
};
|
||||||
|
|
||||||
setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) {
|
setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) {
|
||||||
|
@ -114,6 +116,7 @@ TEST_F(ParserInitialDTest, dropDnode) {
|
||||||
ASSERT_EQ(std::string(req.fqdn), std::string(expect.fqdn));
|
ASSERT_EQ(std::string(req.fqdn), std::string(expect.fqdn));
|
||||||
ASSERT_EQ(req.port, expect.port);
|
ASSERT_EQ(req.port, expect.port);
|
||||||
ASSERT_EQ(req.force, expect.force);
|
ASSERT_EQ(req.force, expect.force);
|
||||||
|
ASSERT_EQ(req.unsafe, expect.unsafe);
|
||||||
});
|
});
|
||||||
|
|
||||||
setDropDnodeReqById(1);
|
setDropDnodeReqById(1);
|
||||||
|
@ -124,6 +127,10 @@ TEST_F(ParserInitialDTest, dropDnode) {
|
||||||
run("DROP DNODE 2 FORCE");
|
run("DROP DNODE 2 FORCE");
|
||||||
clearDropDnodeReq();
|
clearDropDnodeReq();
|
||||||
|
|
||||||
|
setDropDnodeReqById(2, false, true);
|
||||||
|
run("DROP DNODE 2 UNSAFE");
|
||||||
|
clearDropDnodeReq();
|
||||||
|
|
||||||
setDropDnodeReqByEndpoint("host1", 7030);
|
setDropDnodeReqByEndpoint("host1", 7030);
|
||||||
run("DROP DNODE 'host1:7030'");
|
run("DROP DNODE 'host1:7030'");
|
||||||
clearDropDnodeReq();
|
clearDropDnodeReq();
|
||||||
|
@ -132,6 +139,10 @@ TEST_F(ParserInitialDTest, dropDnode) {
|
||||||
run("DROP DNODE 'host2:8030' FORCE");
|
run("DROP DNODE 'host2:8030' FORCE");
|
||||||
clearDropDnodeReq();
|
clearDropDnodeReq();
|
||||||
|
|
||||||
|
setDropDnodeReqByEndpoint("host2", 8030, false, true);
|
||||||
|
run("DROP DNODE 'host2:8030' UNSAFE");
|
||||||
|
clearDropDnodeReq();
|
||||||
|
|
||||||
setDropDnodeReqByEndpoint("host1");
|
setDropDnodeReqByEndpoint("host1");
|
||||||
run("DROP DNODE host1");
|
run("DROP DNODE host1");
|
||||||
clearDropDnodeReq();
|
clearDropDnodeReq();
|
||||||
|
@ -139,6 +150,10 @@ TEST_F(ParserInitialDTest, dropDnode) {
|
||||||
setDropDnodeReqByEndpoint("host2", tsServerPort, true);
|
setDropDnodeReqByEndpoint("host2", tsServerPort, true);
|
||||||
run("DROP DNODE host2 FORCE");
|
run("DROP DNODE host2 FORCE");
|
||||||
clearDropDnodeReq();
|
clearDropDnodeReq();
|
||||||
|
|
||||||
|
setDropDnodeReqByEndpoint("host2", tsServerPort, false, true);
|
||||||
|
run("DROP DNODE host2 UNSAFE");
|
||||||
|
clearDropDnodeReq();
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo DROP function
|
// todo DROP function
|
||||||
|
|
Loading…
Reference in New Issue