Commit Graph

496 Commits

Author SHA1 Message Date
62acf5d098 Limit the memory usage of Loading process (#1954) 2019-10-15 09:26:20 +08:00
f130bd3e7b Use Env function to operate directory (#1980)
Now Env has unify all environment operation, such as file operation.
However some of our old functions don't leverage it. This change unify
FileUtils::scan_dir to use Env's function.
2019-10-15 09:25:12 +08:00
4391152168 Make variable argument UDAF work (#1982) 2019-10-15 09:24:53 +08:00
9fb9dbefca Get rid of compaction on rowset when making snapshot (#1977)
When making snapshot for incremental clone, missed singleton versions may have been compacted.
So get_rowset_by_version() will not acquire any rowset.
This rowset should be acquired from _inc_rs_version_map.
2019-10-14 22:07:31 +08:00
01e71def63 Update engine_clone_task.cpp (#1979) 2019-10-14 16:23:04 +08:00
a6a9b0021f Check tablet state before update it (#1974)
After alter BE try to set tablet state to running but the tablet maybe dropped
2019-10-14 16:04:47 +08:00
fb7e63038b Fix compile fail (#1971) 2019-10-14 10:24:13 +08:00
e3cc0ee93e Fix empty string bug in dict encoding (#1970) 2019-10-14 10:05:00 +08:00
d68b1b287c Support segment-level zone map (#1931) 2019-10-13 22:06:09 +08:00
7eece1e9e2 Support variable arguments for UDAF (#1968) 2019-10-13 22:04:23 +08:00
80e9b21fb0 Make Segment v2 use string's real length(#1943) (#1944) 2019-10-13 13:23:43 +08:00
8232261df1 Lost rowset during tablet revise tablet meta (#1967) 2019-10-12 23:30:11 +08:00
463b462b8d Add create_time to information_schema.tables 2019-10-12 21:45:14 +08:00
de4e45cd08 Make Schema Change work on segment V2 (#1965) 2019-10-12 21:32:53 +08:00
7370b44ab2 Tablet report does not set version miss (#1961) 2019-10-12 14:36:49 +08:00
4678ec8dd9 Delete unused log (#1957) 2019-10-11 23:12:38 +08:00
71731b25f4 Ignore some compaction errors to reduce logs (#1955) 2019-10-11 19:58:38 +08:00
4a17152f40 Add tdigest compression param for pencentile_approx function (#1939) 2019-10-11 18:56:59 +08:00
948f497dd4 Fix some warning when compile type is debug using -Werror flag(because of use deprecated funcrtions) (#1953) 2019-10-11 17:21:41 +08:00
0e4b3755a2 Refactor txn manager methods (#1950) 2019-10-11 17:16:13 +08:00
d5493fb20a Replace std::regex with RE2 (#1930)
In Storage Engine GC, TabletManger use std::regex to extract tablet id
and schema hash from path. But it will construct regex pattern for
every path to check, this is a huge waste. This change list make this
pattern a global static pattern, and replace it with RE2, which has
better performance.
2019-10-11 15:57:53 +08:00
e267d031bb Enhance the speed of avg function (#1889)
This commit enable the avg operator in fe instead of converting the avg function into sum/count.
Also, this commit fix the bug of deciamlv2 avg which cause the core in be.
The int128 could not be assinged directly.

The speed of avg function is similar to sum function after enhancement.
2019-10-10 22:43:46 +08:00
e4f3e8fda7 Remove redundant method in rowset meta manager (#1949) 2019-10-10 19:29:59 +08:00
b72a4a4bc6 Add tablet meta checkpoint mechanism (#1936) 2019-10-10 09:39:02 +08:00
024348d74b Enable auto convert when check in (#1926)
Leverage gitattributes to enable auto convert end-of-line to LF when
checking in. Convert already exist CRLF to LF by removing all files and
checking out with new .gitattributes file. Except .gitattributes, all
files are only modified at the end of line.
2019-10-09 22:31:27 +08:00
a6b843c04d Fix OrdinalPageIndex header size (#1938) 2019-10-09 22:07:27 +08:00
cbf6214762 Add a miss break (#1923) 2019-09-30 20:32:05 +08:00
4e8d728e75 Remove unused code and unnecessary check (#1918) 2019-09-30 18:35:30 +08:00
8aa8e08f27 v2 segment support string encode(#1766) (#1816)
major change

change data format of binary dict page, appending (dict page data) and (dict page offset) to binary dict page;
add new decoding method for new binary dict page format
add ut for segment test
set the elements of initial array to 0 ,when calling arena.AllocateNewBlock
hard code way to choose dict coding for string
0919 commit major change

change dict file format:when saving binary dict page, separate dict page from dict page,one dict page may have multi data pages;when reading a binary dict page,one ColumnReader keeps one dict page
loading dict when calling column_reader._read_page
3.rollback BinaryDictPage
no longer using memset(0) to inital column_zonemap.max_value
0926 17 commit major change

init column_zone_map min value column_zone_map slice's data array;
set char/varchar column_zone_map'max value size to 0
add ut for char column zone map query hit/miss
0929 10 commit major change

allocate mem for column_zone_map 's max and min value
direct copy content to column_zone_map's max and min value
2019-09-30 16:25:31 +08:00
69d0a34bfd Remove unused _request_columns_size from olap_scanner (#1916) 2019-09-30 15:25:10 +08:00
2cecf5901f Fix segment v2 bug (#1904) 2019-09-30 13:50:39 +08:00
262c7f4834 Make All BE UT pass in debug mode (#1913)
Fix OrdinalPageIndexTest
Fix ColumnReaderWriterTest
Fix binary_dict_page_test
Fix routine_load_task_executor_test
2019-09-29 19:37:51 +08:00
eca3b4bb8e Fix BetaRowsetTest in debug mode (#1912) 2019-09-29 18:20:20 +08:00
f852f50acb Improve unique id performance (#1911)
Remove the default constructor for UniqueID
Add a gen_uid method in UniqueId. If need to generate a new uid, users should call this api explicitly.
Reuse boost random generator not generate a new one every time.
2019-09-29 18:20:02 +08:00
8f016d3ab2 Make HLL be able to handle invalid data (#1908)
In this change list
1. validate HLL column when loading data, if data is invalid, this row
will be filtered.
2. seems as empty HLL when serializing invalid type of HLL data, with
this change, all ingested data will be valid.
3. seems as empty HLL when deserializing nullptr or invalid type of HLL data.
With this change, dirty data can be handled normally.
4. rename function empty_hll to hll_empty.
5. disable memtable_flush_execute_test because this will fails
sometimes. When tearing down, some thread is not joined, and they will
visit destroyed resource, which is invalid.
2019-09-29 10:55:23 +08:00
d3a445ee09 Fix memory_scratch_sink_test in debug mode (#1906) 2019-09-28 10:33:24 +08:00
1131f53420 Fix parquet_scanner_test in debug mode (#1900) 2019-09-28 01:15:33 +08:00
cafb9f1e62 Replace Arena with MemPool first step (#1899) 2019-09-28 01:12:22 +08:00
0c22d8fa08 Add frame_of_reference page (#1818) 2019-09-28 01:10:29 +08:00
e67b398916 Fix bug that backup may create an empty file on remote storage. (#1869)
Sometime the broker writer failed to close, but we do not handle this failure.
This may create an empty file on remote storage but be treated as normal.

Also enhance some usabilities:
1. getting latest 2000 transactions instead of getting the earliest.
2. Show backend which download and upload tasks are being executed.
2019-09-28 00:11:43 +08:00
1c229fbd92 Fix es_scan_reader_test in debug mode (#1905) 2019-09-28 00:02:30 +08:00
2f0808137a Refactor FrontendHelper (#1888) 2019-09-27 13:21:14 +08:00
ee59b18daa Change atomic_int64_t to atomic<int64_t> (#1890)
atomic_int64_t is not available in gcc5
2019-09-26 20:57:13 +08:00
b246d93128 Avoid SerDe for aggregation query with object pool (#1854) 2019-09-26 13:51:13 +08:00
7df1418ff4 Check transaction_id in TClearTransactionTaskRequest (#1872) 2019-09-26 10:15:43 +08:00
5d1165fad2 Fix direct compilation failed #1862 (#1875)
Fix direct compilation failed:

fix compile thirdparty in ubuntu will install libs to lib dir instead of lib64
fix compile error in gcc5 due to the defect of c++11 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970)
fix gcc version check will not work on some OS
2019-09-26 09:34:41 +08:00
09482c9f52 Take segments in singleton rowset into consideration upon cumulative compaction (#1866)
In previous compaction, only rowsets will be taken into consideration.
Doing streaming load, the singleton rowset may is made up of many overlapping segments.
Scanning these overlapping segments will result in read amplification.
To address this problem, overlapping segments should be taken into consideration
when doing cumulative compaction to reduce read amplification.
2019-09-25 15:27:44 +08:00
e43f1a2766 Fix NPE error when creating table with bool column (#1864) 2019-09-25 14:40:13 +08:00
eb840ecca8 Support boolean/date/datetime/decimal types in segment V2 (#1863) 2019-09-25 13:53:00 +08:00
c643cbd30c Optimize the load performance for large file (#1798)
The current load process is:

Tablet Sink -> Tablet Channel Mgr -> Tablets Channel -> Delta Writer -> MemTable -> Flush to disk

In the path of Tablets Channel -> DeltaWriter -> MemTable -> Flush to disk, the following operations are performed:

Insert tuple into different memtables according to tablet ID
When the memtable size reaches the threshold, it is written to disk.
The above operations are equivalent to single thread execution for a single load task.
In fact, the insertion of memtable and the flush of memtable can be executed synchronously.
Perform these operation in single thread prevents the insertion of memtable from being delayed due to slow disk writing.

In the new implementation, I added a MemTableFlushExecutor class with a set of flush queues and corresponding worker threads.
By default, each data directory uses two worker threads for flush, which can be modified by the parameter flush_thread_num_per_store of BE.
DeltaWriter will push the full memtable to MemTableFlushExecutor for flush operation and generate a new memtable for receiving new data.

This design can improve the performance of load large files.
In single host testing, the time to load a 1GB text file is reduced from 48 seconds to 29 seconds.
2019-09-25 13:49:32 +08:00