[MCOL-498] provide option to not preallocate disk on extents Created: 2017-01-10 Updated: 2020-02-16 Resolved: 2019-09-20 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.0.6 |
| Fix Version/s: | 1.4.0 |
| Type: | New Feature | Priority: | Major |
| Reporter: | David Thompson (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | documentation, relnote | ||
| Issue Links: |
|
||||||||
| Sprint: | 2018-05, 2018-06, 2018-07, 2018-08, 2018-09, 2018-10, 2018-11, 2018-12, 2018-13, 2018-14, 2018-15, 2018-16, 2018-17, 2018-18, 2018-19, 2018-20, 2018-21, 2019-01, 2019-02, 2019-03, 2019-04, 2019-05, 2019-06 | ||||||||
| Description |
|
A configuration should be provided to allow for not preallocating disk storage on extent creation. This would be useful for ssd storage where contiguous allocation is not important and this would also reduce wear slightly. |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2017-02-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think there is a good middle ground here that means we won't need an option and will optimise SSD and spinning disk file creation... If we use fallocate to set the size upon extent creation (and expansion) then the continuous space will be allocated without zeroing out the space. We wouldn't need an option for this as the default behaviour is good for SSD and spinning disk, it will improve the file creation performance of both and will remove the needless writes for SSDs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Allan [ 2017-05-10 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Some technical thoughts (not issues). Assume that there are two processes that each have open handles to the same underlying files on the server. In one of them a truncate/delete of the file is done because it is doing a delete operation, and also assume that to do the delete it holds a lock on the files. The truncate completes and the kernel marks the appropriate inodes and the lock is released. That disk space is gone. But it can't actually be released because the other process has a handle to the files. The only way to actually release the space is for all processes that hold handles to close them so the kernel can actually release the disk space for other use. My thought is that if the server holds on to the open files after a delete that that space will never be reclaimed until the server is restarted. You should not have to restart the server to reclaim the space. And of course you may already be doing all this. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The tests shows that dedicated NULL values, used to fill the segment file up, aren't essential, so I implemented that good idea with fallocate() usage where possible. However some file systems lack fallocate() call,so I also add a setting to disable segment file preallocation on a per-PM basis. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please, review the PR. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unfortunately as it stands this patch causes a regression. Aggregates are producing incorrect results. Likely because they are seeing whole blocks as used now rather than partly used when they were being filled with the 'empty' byte pattern. This is one of the diffs from test000 failure:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-12-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please review the code change. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-12-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The feature allows one to disable space preallocation when CS adds new or expands abbreviated extents. Nevertheless CS preallocates initial abbreviated extents using fallocate (if filesystem supports it) or sequential write as fallback. Abbreviated extents uses 2MB of disk space only.
It is easy to check that the feature works. Disable space preallocation as said before. Then create a table and insert > 8kk rows into it. Check for disk space used with this query.
Previous CS versions eventually allocate 64MB files and now it allocates the exact needed amount of disk space. I used this sequence to create a test table.
Here is the link to a 1.5kk dataset to use with the table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-12-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please review the change. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Patrick LeBlanc (Inactive) [ 2019-01-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reviewed it, requested a couple changes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2019-03-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please review the feature that allows to disable disk space preallocation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2019-04-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For QA: Here is the snippet from the XML config to disable disk space preallocation for dbroot 1:
Here is the scenario to check the feature works. Upload >= 300 000 records in the table then check the size of the segment/dictionary files:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2019-09-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 1.4.0-1 [dlee@master centos7]$ cat gitversionInfo.txt Test #1 Create database only, no dataloading 1.2.5-1 [root@localhost data1]# du -sh 000.dir Each database creation used about 147MB 1.4.0-1 [root@localhost data1]# du -sh 000.dir Each database created used 11MB Test #2 1.2.5-1 [root@localhost columnstore]# du -sh data1/000.dir For the 1m database, it used 205M only, the same amount of disk space as create database only in test #1. 1.4.0-1 [root@localhost columnstore]# du -sh data1/000.dir Test #3 Compare disk space utilizaiton on a 1um2pm stack. with no user database [root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1m columnstore 1m
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1g columnstore 1g
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch10g columnstore 10g
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir Start with an empty stack again [root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir [root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2019-09-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Test results for S3 installation wiht localStorage, single server 1.4.0-1
empty system [root@localhost storagemanager]# du -sh * [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1 columnstore 1g
[root@localhost storagemanager]# du -sh *
[root@localhost storagemanager]# du -sh * [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1 columnstore 1g
[root@localhost storagemanager]# du -sh *
[root@localhost storagemanager]# du -sh * [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch10 columnstore 10g
[root@localhost storagemanager]# du -sh *
[root@localhost storagemanager]# du -sh * | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2019-09-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Test results for gluster, 1um2pm configuration 1.4.0-1 dbroot 1 used empty system [root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1 columnstore 1g
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch1 columnstore 1g
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir [root@localhost storagemanager]# /data/qa/autopilot/databases/dbt3/sh/buildDatabase.sh tpch10 columnstore 10g
[root@localhost columnstore]# du -sh data1/000.dir [root@localhost columnstore]# du -sh data2/000.dir |