Commit Graph

3297 Commits

Author SHA1 Message Date
39bb669dcb [BUG] fix extra memory copy in bitmap value (#6599) 2021-09-10 09:52:41 +08:00
4f744333c2 fix some core in local test: (#6594)
1. insert very large string value may coredump
    2. some analitic functiuon and agg function result may be incorrect
    3. string compare may be coredump when string type is too large
    4. string type in delete condition can not process correctly
    5. add text/blob as alias of string to compitable with mysql
    6. fix string type min/max agg may  process incorrectly
2021-09-10 09:52:03 +08:00
30b54cae23 [bug] Fix dataTables bootstrap js version differ. (#6591)
Co-authored-by: 潘利杰 <panlijie@inspur.com>
2021-09-09 14:26:11 +08:00
b3f02955d3 [Doc] modify irregular documents (like/ not like/ regexp.md) (#6572) 2021-09-09 14:11:37 +08:00
de66312a1a [Job Clean] Sort out the cleanup logic of historical jobs (#6553)
There are many historical job records in Doris, such as load jobs, alter jobs, export jobs and so on.

These historical jobs are generally cleaned up periodically by the cleanup thread, to avoid taking too much memory.

This PR reorganized the cleanup logic of historical jobs and optimized the cleanup logic of some historical jobs
to reduce the memory usage of historical jobs.

The following FE configuration items are related to historical job cleaning:

1. label_keep_max_second

    Used to determine whether LoadJob, LoadJobV2, RoutineLoadJob or TransactionState are expired.

2. streaming_label_keep_max_second

    Used to determine whether InsertJob, DeleteJob  or TransactionState are expired.
    Different from label_keep_max_second, this config is used to clean up these frequently submitted jobs or load transactions.

3. history_job_keep_max_second

    Used to determine whether AlterJob, ExportJob are expired
2021-09-07 16:57:45 +08:00
56b2a33a4d [Feature] Support Integer-Types value in like predicate (#6579)
The basic idea is adding a rewrite rule to rewriete the expr of `SlotRef`, 
which type is fixedPointValue, aka Integer-Types, to a `CastExpr`, it will cast the fixedPoint value to string.
2021-09-07 11:56:52 +08:00
74ddea8d83 [Optimize] Remove some unused code to reduce lock contention (#6566)
1. Remove global runtime profile counter
2. Remove unused thread token register
2021-09-07 11:56:12 +08:00
Pxl
577ff01094 [Bug][Function] Fix pad function wrong result when len.val==str_char_size (#6564)
like #6563 and #6562
2021-09-07 11:55:49 +08:00
bf6d043a7e [Bug] Fix bug that can not repair replica in DECOMMISSION state (#6560)
Fix bug that if a tablet belongs to a colocation table, and one of its
replica is in DECOMMISSION state. This tablet can not be repaired.

Also fix a bug that quota does not escape in show create table result.

```
COMMENT "a"bc" to COMMENT "a\"bc"
```
2021-09-07 11:55:23 +08:00
80cb22c880 [Bug] [Truncate] Fix tablet number is different between the new partition and base partition after truncate operation (#6552)
Fix #6551 

`Truncate` operation will create new partition to replace base partition.
Tablets in new partition would be created based on table default bucket number.
If the number of tablet for a partition is different from table default bucket number,
the number of tablet will be different between the new created partition and base partition after truncate operation.

In any case, the new partition should have the same number of tablet as the base partition after truncate operation. 
Tablets in new partition should be created based on tablet number of base partition rather than table default bucket number for truncate operation.
2021-09-07 11:54:15 +08:00
9469b2ce1a [Outfile] Support concurrent export of query results (#6539)
This pr mainly supports
1. Export query result sets concurrently
2. Query result set export supports s3 protocol

Among them, there are several preconditions for concurrently exporting query result sets
1. Enable concurrent export variables
2. The query itself can be exported concurrently
    (some queries containing sort nodes at the top level cannot be exported concurrently)
3. Export the s3 protocol used instead of the broker

After exporting the result set concurrently,
the file prefix is changed to outfile_{query_instance_id}_filenumber.{file_format}
2021-09-07 11:53:32 +08:00
d25f5ed911 [Metric] Add more metrics for FE checkpoint operation (#6522)
Counter of image write success or failure:
image_write{"type" = "success"}
image_write{"type" = "failed"}

Counter of image push to other FE nodes success or failure:
image_push{"type" = "success"}
image_push{"type" = "failed"}

Counter of old image clean success or failure:
image_clean{"type" = "success"}
image_clean{"type" = "failed"}

Counter of old edit log clean success or failure:
edit_log_clean{"type" = "success"}
edit_log_clean{"type" = "failed"}
2021-09-07 11:52:55 +08:00
2324e28288 [Enhance] Add a rewrite rule of compoundPredicate 'OR' 'AND' to hit prefix index (#6518)
add a rewrite rule of compoundPredicate 'OR' 'AND' to hit prefix index
unit test added.

`````
case true AND expr ==> expr
case expr AND true ==> expr
case false Or expr ==> expr
case expr Or false ==> expr
 
case false AND expr ==> false
case expr AND false ==> false
case true Or expr ==> true
case expr Or true ==> true
`````
2021-09-07 11:52:41 +08:00
1fc6ee1597 [Config] Add config to support long table name (#6501)
Support length of table name large than 64
2021-09-07 11:52:07 +08:00
f591098b08 [Feature] Support fe login using sql tools when no be is available. (#6150)
When no backend(be) available, eg first time before setup or all be is down, we cannot login to fe using most sql tools, eg datagrip, querious.

This is because these tools call `select version()` or  `select @@version_comment …` right after login, when there is no backend available, the login will fail.

I make this pr to support login when no be available, so we can add backend or modify some configuaration using GUI sql tools, especially the first setup time.

This pr is working at precondition that,sql tools only query very simple information that fe can handle, there is no need to send the request to be.

So I check the query type and BE status, if we can handle the query and no BE is available, we will intercept and process in fe.
2021-09-07 11:51:46 +08:00
1206f9a17f [RuntimeFilter] support TYPE_STRING in runtime filter (#6573) 2021-09-06 11:55:11 +08:00
b3cb1e271d [bug] Fix the bug that http redirects to master cannot be authenticated, and redirect several http interfaces to master. (#6557)
Redirect the following http requests to master:
    /rest/v2/api/cluster_overview
    /rest/v2/manager/node/frontends
    /rest/v2/manager/node/backends
    /rest/v2/manager/node/brokers
2021-09-06 11:00:39 +08:00
00ecb2904b [Bug] Fix colocate agg error when group of colocate table is unstable (#6559)
If the colocate group of the table is not stable,
then even if it is a colocate table,
its data distribution is Random.
So the distribution info of OlapScanNode is also Random instead of Hash Partition.

Fixed #6558
2021-09-04 11:00:12 +08:00
7db8841ae2 [Feature][ResourceTag] Support Resource Tag (#6203)
#5902 
This CL mainly changes:

1. Support setting tags for BE nodes:

    ```
    alter system add backend "1272:9050, 1212:9050" properties("tag.location": "zoneA");
    alter system modify backend "1272:9050, 1212:9050" set ("tag.location": "zoneB");
    ```
    And for compatibility, all BE nodes will be set a "default" tag when upgrading: `"tag.location": "default"`.

2. Create a new class `ReplicaAllocation` to replace the previous `replication_num`.

    `ReplicaAllocation` represents the allocation of the replicas of a tablet. It contains a map from 
    Tag to number of replicas.
    For example, if user set a table's replication num to 3, it will be converted to a ReplicaAllocation
    like: `"tag.location.default" : "3"`, which means the tablet will have 3 replicas and all of them will be
    allocated in BE nodes with tag "default";

3. Support create table with replication allocation:

    ```
    CREATE TABLE example_db.table_hash
    (
    k1 TINYINT
    )
    DISTRIBUTED BY HASH(k1) BUCKETS 32
    PROPERTIES (
        "replication_allocation"="tag.location.zone1:1, tag.location.zone2:2"
    );
    ```
    
    Also support set replica allocation for dynamic tables, and modify replica allocation at runtime.

    For compatibility, user can still set "replication_num" = "3", and it will be automatically converted to:
    ` "replication_allocation"="tag.location.default:3"`

4. Support tablet repair and balance based on Tag

    1. For tablets of non-colocate table, most of the logic is the same as before,
       but when selecting the destination node for clone, the tag of the node will be considered.
       If the required tag does not exist, it cannot be repaired.
       Similarly, under the condition of ensuring that the replicas are complete, the tablet will be
       reallocated according to the tag or the replicas will be balanced.

       Balancing is performed separately within each resource group.

    2. For tablets of colocate table, the backends sequence of buckets will be splitted by tag.
       For example, if replica allocation is "tag.location.zone1:1, tag.location.zone2:2",

       And zone1 has 2 BE: A, B; zone2 has 3 BE: C, D, F

       there will be 2 backend sequences: one is for zone1, and the other is for zone2.
       And one posible seqeunces will be:


       zone1: [A]   [B]   [A]   [B]
       zone2: [C, D][D, F][F, C][C, D]

5. Support setting tags for user and restrict execution node with tags:


    ```
    set property for 'cmy' 'resource_tags.location' : 'zone1, zone2';
    ```

    After setting, the user 'cmy' can only query data stored on backends with tag zone1 and zone2,
    And query can only be executed on backends with tag zone1 and zone2


    For compatibility, after upgrading, the property `resource_tags.location` will be empty,
    so that user can still query data stored on any backends.

6. Modify the Unit test frame of FE so that we can created multi backends with different mocked IP in unit test.

    This help us to easily test some distributed cases like query, tablet repair and balance

The document will be added in another PR.

Also fix a bug described in #6194
2021-09-04 10:59:35 +08:00
df54b34f98 [Catalog] Enforce null check at Catalog.getDb and Database.getTable (#6416)
fix #5378 #5391 #5688 #5973 #6155 and all replay NPE. All replay method can now throw MetaNotFoundException and caught to log a warning for potential inconsistent metadata cases.

try to establish a clear notice for future developer to check null.
2021-09-03 13:34:49 +08:00
79fd117d60 Update load-json-format.md (#6546)
change stripe_outer_array to strip_outer_array
2021-09-02 16:08:09 +08:00
6ac0ab6b29 fix(sparkload): bitmap deep copy in or operator (#6480)
* fix(sparkload): bitmap deep copy in `or` operator

fix multi rollup hold the same Ref of bitmapvalue which may be updated repeatedly.

* fix(sparkload): bitmap deep copy in `or` operator

fix multi rollup hold the same Ref of bitmapvalue which may be updated repeatedly.

Co-authored-by: weixiang <weixiang06@meituan.com>
2021-09-02 12:15:02 +08:00
57199955d6 [Compaction][ThreadPool]Support adjust compaction threads num at runtime (#5781)
* adjust thread number of compaction thread pool dynamically

Co-authored-by: weizuo <weizuo@xiaomi.com>
2021-09-02 10:01:44 +08:00
d8cde8c044 (#6454) Remove useless code for Segment V2 (#6455) 2021-09-02 09:59:21 +08:00
7a15e583a7 [Feature]Support functions of json_array, json_object, json_quote (#6504) 2021-09-02 09:59:02 +08:00
Pxl
4dd610c28d [Feature] Support for storage layer benchmark (#6506)
* add benchmark tool
2021-09-02 09:57:19 +08:00
9f7d4cf741 [BUG] fix bugs with string type (#6538)
* fix bugs with string type
1. not support string with agg type min/max
2. agg_update with large string may coredump
3. stringval with large string may coredump
4. not support string as partition key
2021-09-01 15:59:55 +08:00
e01a845a4a [Doc] Update stream-load-manual.md (#6524)
Origin stream load column order transformation is unclear , a user is struggling for a long time in this part ,so i modified some expressions to make it clearer.
2021-09-01 13:28:25 +08:00
e795c7d2cc [Community] Add new template for issues (#6534)
* [Community] Add new template for issues

Inpired by Apache Skywalking

https://github.com/apache/skywalking/issues/new?assignees=&labels=bug&template=bug-report.yml&title=%5BBug%5D+
2021-09-01 09:59:44 +08:00
a949dcd9f6 [Feature] Create table like clause support copy rollup (#6475)
for issue #6474

```sql
create table test.table1 like test.table with rollup r1,r2 -- copy some rollup

create table test.table1 like test.table with rollup all -- copy all rollup

create table test.table1 like test.table  -- only copy base table
```
2021-08-31 20:33:26 +08:00
138e7e896d Fix min(string) Unable to find symbol (#6531) 2021-08-31 11:19:13 +08:00
d5d8316ff3 [Optimize][Clone] Take version count into consideration when choosing src replica for clone task (#6513)
Fix #6512 

If there is missing replica for a tablet, clone task will be executed to restore missing replica from a healthy replica. Src replica selector will randomly choose a healthy replica as src replica.

It's better to choose the health replica with min version count as src replica so that it could avoid repetitive compaction task. In addition, replica with less version count is good for query performance.
2021-08-30 18:52:41 +08:00
7324f4b0ae [Bug] Regularly clean up old DeleteInfos in the DeleteHandler (#6448)
fix #6447
1. FE master regularly triggers the remove operation
2. After the master completes the removal of deleteInfo, it is synchronized to the Follower through editlog for remove
3. When the DeleteInfo creation time is longer than the current time, it will be cleaned up, which is determined by the `delete_info_keep_max_second` configuration
2021-08-30 18:52:18 +08:00
abbc9202af support routine load isolation_level read_committed (#6191)
Co-authored-by: Geoffrey <gaofeng01@rd.netease.com>
2021-08-30 17:22:08 +08:00
0393c9b3b9 [Optimize] Support send batch parallelism for olap table sink (#6397)
* Support send batch parallelism for olap table sink

Co-authored-by: caiconghui <caiconghui@xiaomi.com>
2021-08-30 11:03:09 +08:00
Pxl
5eed1f897a [Document] update docker env version to 1.3.1 (#6517)
* update docker env version
2021-08-30 11:01:39 +08:00
a2a13dadba [Optimize] Make light schema change complete more faster under concurrent conditions (#6292)
* [Optimize] Make schema change complete more faster under concurrent conditions

Co-authored-by: caiconghui <caiconghui@xiaomi.com>
2021-08-29 09:41:56 +08:00
dedb57f87e [Enhancement] Modify the method of calculating compaction score (#6252)
* optimize calculation method of compaction score to lower the priority of rowset with 0 segments

Co-authored-by: weizuo <weizuo@xiaomi.com>
2021-08-27 11:10:41 +08:00
ace21ebf83 Doris-spark connector examples (#6485)
* doris spark connector examples

* add usage documentation and license

Co-authored-by: shengy <whyMy2017>
2021-08-27 10:57:11 +08:00
3f2fdd236f Add scan thread token (#6443) 2021-08-27 10:56:17 +08:00
4cfebc35a7 Flink reads multiple data sources to doris (#6490)
* Flink reads multiple data sources to doris

Co-authored-by: caol <caol@shuhaisc.com>
2021-08-27 10:55:53 +08:00
a7b8d110a0 Spark 2.x and 3.x version compilation instructions (#6503)
Spark 2.x and 3.x version compilation instructions
2021-08-27 10:55:29 +08:00
7235d86331 [Bug] Support show load for insert 0 row (#6510)
* support show load for insert 0 row

* support show load for insert 0 row

Co-authored-by: weizuo <weizuo@xiaomi.com>
2021-08-27 10:55:02 +08:00
bfb2252175 [RuntimeFilter] provide no simd block bloom filter implement to support arm (#6511) 2021-08-27 10:22:36 +08:00
ca3eb6490e push down conditions on unique table value columns to base rowset (#6457) 2021-08-26 09:14:49 +08:00
acc5fd2f21 [BUG] Fix string type cast bug and runtime filter may core when not support avx2 (#6495)
* fix string type cast bug and runtime filter instructions may not support

* add arm support
2021-08-26 09:14:31 +08:00
5419d74abf [Doc]Update hit-the-rollup.md (#6430) 2021-08-25 22:35:05 +08:00
92e50504e5 [Feature] Supports case-insensitive table names. (#6403)
Implement the lower_case_table_names variable of mysql. The value meaning is as follows:
0: the table names are case-sensitive.
1: table names are stored in lowercase and comparisons are not case sensitive.
2: table names are stored as given but compared case-insensitively.
2021-08-25 22:34:45 +08:00
96013decd3 [BUG] Fixed the materialized number of resultExprs/constExprs and output slot of Union Node is inconsistent (#6380) 2021-08-25 22:33:49 +08:00
fa290383dc [Doc] Modify README to add some statistical indicators (#6486)
1. Add license/total line/release badegs.
2. Add monthly active contributor and contributor growth graph
3. fix a pom.xml bug
4. Modify some routine load log on BE side
2021-08-25 09:36:26 +08:00