Commit Graph

5755 Commits

Author SHA1 Message Date
bd72328177 [UT] Fix FE ut bugs (#5387)
This bug is introduced from #5356
2021-02-14 15:59:21 +08:00
51ccd44865 [Load Parallel][3/3] Support parallel delta writer (#5369)
In the previous broker load, multiple OlapTableSinks would send data to the same LoadChannel,
and because of the lock granularity problem, LoadChannel could only process these requests serially,
which made it impossible to make full use of cluster resources.

This CL modifies the related locks so that LoadChannel can process these requests in parallel.

In the test, with a size of 20G, the load speed of 334 million rows of data in 3 nodes has been
increased from 9min to 5min, and after enabling 2 concurrency, it can be increased to 3min.

Also modify the profile of load job.
2021-02-07 22:42:18 +08:00
f12f32da11 [Bug] Support if not exists in create table like stmt (#5368)
Currently we support syntax `create table xx if not exists like xxx`, but `if not exists` does not work well.
2021-02-07 22:41:55 +08:00
2ec55bf19e [LOG] Change some log level (#5361)
Change some log level from error to warn
2021-02-07 22:41:13 +08:00
f77b8ce8e4 [UT] Modify to avoid some UT failure accidentally (#5359)
After an Alter job finished, the job's state is FINISHED, but table's state
may not be NORMAL for a while.
We need to make sure that table's state become NORMAL to continue next UT.
2021-02-07 22:39:45 +08:00
fd81499fbc [Bug] Add space in case and caseExpr when toSql (#5356) 2021-02-07 22:38:54 +08:00
780900ac9c [Feature] Support preceding filter original data when loading (#5338)
Support conditional filtering of original data in broker load and routine load
eg:

```
LOAD LABEL `label1`
(
DATA INFILE ('bos://cmy-repo/1.csv')
INTO TABLE tbl2
COLUMNS TERMINATED BY '\t'
(event_day, product_id, ocpc_stage, user_id)
SET (
	ocpc_stage = ocpc_stage + 100
)
PRECEDING FILTER user_id = 1381035
WHERE ocpc_stage > 30
)
...
```
2021-02-07 22:37:48 +08:00
c283bb3677 [Bug] Fix bug that not erase meta such as tablet when force drop db, table, partition (#5329) 2021-02-07 22:37:18 +08:00
f98b26645c [Bug] Set forceDrop to false when getDropPartitionClause for DynamicPartitionScheduler to avoid that the deleted partition cannot be recovered (#5319)
Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-02-07 22:36:54 +08:00
779c4629b4 [Bug] Fix bug of NPE when replaying spark load job. (#5367)
* [Bug] Fix bug of NPE when replaying spark load job.

The resourceDesc in spark load job may be null because it is not persisted.
So when replaying the job, we should check it.

* fix

* add ut
2021-02-07 11:25:06 +08:00
4ce6f49c0f [LOG] Reduce verbose exception log by catch exceptions (#5229)
In our product environment, we use LVS to dispatch requests to FEs,
however, LVS will send probes to check whether FE is alive, and will
close the connection immediately. It will cause much verbose log,
this patch aim to reduce these log by catch related exceptions.
2021-02-06 23:14:26 +08:00
2a2cec91f9 Adding a column with SUM aggregation to table should restrict the default value (#5315)
One Tablet have three replicas, the compaction progress is different.
Considering the following scenario, replica A have 3 versions(1, 2, 3);
replica B have 2 versions(1-2, 3);
replica C have 1 versions(1-3).
Now a column named city been added with default zero 1.
Replica A will be resulted as 3, replica B results as 2,
replica C results as 1.

So there is a necessity to restrict the default value to zero for SUM aggregation column.
2021-02-05 18:50:04 +08:00
d8202ca9cc [Enhancement] move common codes from fe-core to fe-common and remove log4j1 (#5317) (#5318)
The io related codes may be used by new modules, so It's better to move them to fe-common.

The modification to fe-core is frequent, but there are many generated java files by thrift
will slow down the compilation, so It's better to move thrift generation process to fe-common.

Currently both log4j1 and log4j2 are used, which leads to logs are written to wrong files.
Our modification will remove log4j1 from dependency, use slf4j + slf4j -> log4j2 instead.
2021-02-04 13:41:03 +08:00
b6abcbdd35 Fix 5243 Skip repair replica not in colocate group. (#5250)
* Fix 5243 Skip repair replica not in colocate group.

* Remove useless parameter& Add UT

* Update fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
2021-02-04 12:04:19 +08:00
ed9c70bdb9 [Bug] Fix bug of create ODBC table first column is float or double, issue#5350 (#5351) 2021-02-04 09:32:53 +08:00
77b756fb87 [Refactor] Remove redundant code of mini load and insert (#4966)
The content deleted by this PR includes mini load and insert in the old framework.
The task and scheduling logic of old framework has been deleted.
2021-02-03 22:19:20 +08:00
059791c6ac [Config] Change some defualt value of Doris config (#5348)
1. Default enable bucket shuffle join in session variables.
2. Remove config of FE enable_odbc_table.
2021-02-03 13:22:38 +08:00
47e33c7987 Support create index on unique value column (#5305)
* support create index on unique table value columns
2021-02-03 13:22:00 +08:00
ddd85d8ae8 [ODBC] Fix Memory consumption of ODBC MySQL Driver (#5322) (#5323) 2021-02-01 00:12:49 +08:00
bb7ba00ccf [Backup]Support content, exclude and whole database in backup (#5314)
This PR support following functions:
1. Support content properties in backup stmt. It means user can backup only metadata or
meta+data which use content [METADATA_ONLY| ALL]attribute to distinguish.
2. Support exclude some tables in backup and restore stmt. This means that some
very large and unimportant tables can be excluded when the entire database is backed up.
3. Support backup and restore whole database instead of declaring each table name
in the backup and restore statement.

The backup and restore api has changed as following:
```
BACKUP SNAPSHOT [db_name].{snapshot_name}
TO 'repo_name'
[ON|EXCLUDE (
    'table_name' [partition (p1,...)]
)]
[properties (
    "content" = "metadata_only|all"
)]

RESTORE SNAPSHOT [db_name].{snapshot_name}
TO 'repo_name'
[EXCLUDE|ON (
    'table_name' [partition (p1,...)]
)]
[properties (
)]
```
2021-02-01 00:12:35 +08:00
be0b0f930c [Load] Load job should not begin transaction when task queue in loadingLoadTaskScheduler is full to avoid txn timeout (#5205) 2021-02-01 00:10:24 +08:00
cd96ded1ad [Bugs] Fix bugs that FE heartbeat api of httpv2 does not return version info (#5306)
Co-authored-by: morningman <chenmingyu@baidu.com>
2021-01-30 20:34:33 +08:00
de57667d6d [Delete] Support delete with multi partitions (#5252)
Support delete statement like:
1. delete from table partitions(p1, p2) where xxx;  // apply to p1, p2
2. delete from table where xxx;     // apply to all partitions

Also remove code about the deprecated sync/async delete job.

This CL changes FE meta version to 94
2021-01-30 20:33:34 +08:00
8fe372f82b [Bug] Fix NoSuchElementException when accessing empty partition info (#5201) 2021-01-30 16:36:24 +08:00
6bd22bc573 [BackupAndRestore] Support backup and restore view and external odbc table (#5299)
[BackupAndRestore] Support backup and restore view and external odbc table

1. Support backup and restore view and odbc table. The syntax is the same as that of the backup and restore table.
2. If the table associated with the view does not exist in the snapshot,
   the view can still be backed up successfully, but the TableNotFound exception will be thrown when querying the view.
3. If the odbc table associated with the odbc resource, the odbc resource will be backuped and restored together.
4. If the same view, odbc table and resource already exists in the database, it will compare whether the metadata of snapshot is consistent.
   If it is inconsistent, the restoration will fail.
4. This pr also modified the json format of the backup information.
   A `new_backup_objects` object is added to the root node to store backup meta-information other than olap table,
   such as views and external tables.
   ```
   {
       "backup_objects": {},
       "new_backup_objects": {
           "view": [
               {"name": "view1", "id": "10001"}
           ],
           "odbc_table": [
               {"name":"xxx", xxx}
           ]
           "odbc_resources": [
               {"name": "bj_oracle"}
           ]
       }
   }
   ```
5. This pr changes the serialization and deserialization method of backup information
   from manual construction to automatic analysis by Gson tools.

Change-Id: I216469bf2a6484177185d8354dcca2dc19f653f3
2021-01-28 18:50:18 +08:00
e774314ffb Fix some problems related to thrift rpc when use nonblokcing IO model (#5117)
* Fix some problems related to thrift rpc when use nonblokcing IO model

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-28 10:57:30 +08:00
54814a7260 [Auidt] Fix bug for that only the last statement can be audited when user send multi-statement (#5244)
Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-28 10:54:18 +08:00
ca10205137 [Function] Support show create function statement (#5197)
* [Function]Support show create function stmt

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-28 10:52:37 +08:00
41ef9ccda9 (#5224)some little fix for spark load (#5233)
* (#5224)some little fix for spark load

* 1 use yyyy-MM-dd instead of YYYY-MM-DD
2 unify lower case for bitmap column name
2021-01-27 11:16:59 +08:00
067abac342 [bug] fix bug of getBrokerDesc object is null (#5295)
Co-authored-by: wangxiaobaidu11 <328642799@qq.com>
2021-01-26 09:12:44 +08:00
3db08a14bf [Bug] Fix bug of outer join cause error result. (#5285)
issue: #5284
2021-01-24 10:14:26 +08:00
7e61400e3c [Load Parallel][1/3] Broker Load supports setting the load parallelism (#5277)
* [Load] Broker Load supports setting the load parallelism

Similar to the parallel_fragment_exec_instance_num parameter,
it allows the user to set the parallelism of the load execution plan
on a single node when the broker load is submitted.

eg:
```
...
properties (
"load_parallelism" = "4";
...
)
```

This parameter is currently only used to support the load parallelism setting,
but it cannot significantly improve the load speed for the time being.
The speed increase will be completed in subsequent code submissions.
Documents will also be added in subsequent submissions.

This PR also update the FE meta version.
2021-01-24 10:09:53 +08:00
d3f1b49faa [Bug] Fix bug that recover table throw NPE (#5279) 2021-01-23 21:09:54 +08:00
2ddf537094 [Meta] Add some consistency check in image put api (#5219) 2021-01-23 21:08:04 +08:00
50ba5d336d [Bug] Colocate Join and Bucket shuffle join may scan some tablet twice time. (#5256)
Fix issue #5255
2021-01-20 21:42:04 +08:00
b25bcee5d3 [Bug] Remove schema hash and fix bug of calculating table signature (#5254)
1. Schema hash is useless long time ago
    Currently, schema hash can only be generated as a random integer, no need to calculated
    from real schema.

2. The CRC32 algo is not enough to generate the table' signature.
    Table's signature is used to determine whether the tables have the same schema.
    And current CRC32 algo may return same signature even if table's schema are different.

    So I change it to calculate the md5 of a signature string assembled by schema info of a table.
2021-01-20 21:38:06 +08:00
83b7a23d5c fix alter routine load not work (#5257) 2021-01-20 10:52:02 +08:00
a59831d119 [Bug] Fix fe restart failed bug when replay erase table log (#5221)
Co-authored-by: gengjun <gengjun@dorisdb.com>
2021-01-19 10:25:49 +08:00
73a67901ed [Metric] Add system memory metrics for fe (#5149)
Currently, fe's SystemMetrics only support tcp. I add system memory metrics for fe.
Then we can get system memory metrics , which is used to troubleshoot memory problems.
2021-01-17 09:37:01 +08:00
3dcbbbea95 [Enhancement] Fill assignment param of bucket shuffle and colocate shuffle for debug (#5167)
When Doris is in debug mode, function `Coordinator#traceInstance` is used to print
the physical execute plan of a fragment instance for debug.
Function  `Coordinator#traceInstance` uses param `scanRangeAssignment` to print
the detail of a fragment. But bucket shuffle join and colocate shuffle join do not fill the param.
That will cause debug not work well.
This path fill assignment param of bucket shuffle and colocate shuffle for debug.
2021-01-16 21:37:33 +08:00
d692764934 [Optimize]Take all scan nodes of one sql into consideration when select host for a tablet (#4984)
Currently when a scan node scans many tablets, Doris will assure it load balance when choosing which replica for scan task to be executed. But it does not take other scan nodes into consideration to implement a global load balance. This patch tries to make all tables of all scan nodes to be load balance.

Co-authored-by: wangxixu <wangxixu@xiaomi.com>
2021-01-15 11:18:57 +08:00
78b84594e6 [Feature] Support Create Dynamic Partition Immediately FirstTime Without Wating Schedule. (#5209) 2021-01-15 09:46:44 +08:00
f7730031b8 Support read and write lock in table level to reduce lock competition (#3775)
This PR is to reduce lock competition by supporting read and write lock in table level. When we modify or read table's meta, we don't need to get database lock, just get table write or read lock. And when we get database lock, that means meta directly in db cannot be modified by other thread. Database lock only protect meta in Database class, while table lock protect meta in Table class.

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-13 10:27:58 +08:00
98d8e1d53b fix duplicated add delete condition (#5222) 2021-01-13 09:18:15 +08:00
851d45216e Fix daily test failed cause by delete condition (#5211)
* fix daily test failed
2021-01-12 10:54:44 +08:00
05631cfa4f [Config] Add publish timeout param when exec insert (#5170)
Add new session variable to control the timeout of publish task of insert operation.
2021-01-10 20:48:10 +08:00
f2a11fe1f7 [Enhancement] Add more comprehensive prometheus jvm thread metrics on fe (#5112)
Currently, fe thread metrics is very simple, only have thread count and peak_count.
I think we may need more comprehensive prometheus jvm thread metrics on fe.
This will be useful when we want to analysis fe's running status.
2021-01-10 20:43:17 +08:00
65d33cf43c [Function] Add timeout of connection when downloading the function objectFile from URL (#5135)
Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-06 22:43:52 +08:00
1035e86e0b [Enhancement] Optimize the algorithm of selecting host for a bucket scan task when a backend not alive (#5133) 2021-01-06 10:20:16 +08:00
bcf1091043 Fix MaterializedView select with CTE bug (#5165) 2021-01-04 13:42:29 +08:00