[MCOL-278] drop table if exists creates error if table doesn't exist and schema out of synch Created: 2016-08-29 Updated: 2019-12-06 Resolved: 2016-11-23 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MariaDB Server |
| Affects Version/s: | 1.0.2 |
| Fix Version/s: | 1.0.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos 6.5 |
||
| Issue Links: |
|
||||||||
| Sprint: | 2016-22, 2016-23 | ||||||||
| Description |
|
With this statement: columnstore should generate a warning, not an error. |
| Comments |
| Comment by David Hall (Inactive) [ 2016-08-29 ] | ||||||||||||||||
|
This is most likely caused by schema out of sync caused by some crash or assert. In such a case, there is no bug, but the error is disconcerting. | ||||||||||||||||
| Comment by David Thompson (Inactive) [ 2016-10-03 ] | ||||||||||||||||
|
The fix here should be to handle this situation gracefully with a warnining instead of an erorr since most users would use this syntax to have robust scripts that don't fail. Not sure on the best way to recreate the scenario though.. | ||||||||||||||||
| Comment by David Hall (Inactive) [ 2016-10-03 ] | ||||||||||||||||
|
Currently, when this error occurs, the system does not drop the table from the front end (i.e., MariaDB). That is, the .frm files is not deleted. In this case, a warning isn't all that useful, as the table isn't dropped. A subsequent create will fail. Perhaps a better, though more complex solution, is to drop the table from the front-end and issue a warning that the table didn't exist in the engine. At this point, all vestiges of the table will have been removed and the user will get what they expect. In a test environment, this bug can be reproduced by deleting all the table information from the calpont system catalog – calpontsys, Doing so won't delete the data files, so it could clutter up your data directory. A clean out should be done after working on it this way. | ||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-11-22 ] | ||||||||||||||||
|
By reading the comments, I don't know what solution was implemented to fix the issue. | ||||||||||||||||
| Comment by David Thompson (Inactive) [ 2016-11-22 ] | ||||||||||||||||
|
This is the comment from github: Throw warning when table doesn't exist in columnstore so drop table if exists can still remove the front end table. | ||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-11-22 ] | ||||||||||||||||
|
Build tested: 1.0.5-1 mcsadmin> getsoft Name : mariadb-columnstore-platform Functionally, it is working now, but the warning is incorrect, misleading, and unnecessary. Thoughts? -------
------------------
------------------ MariaDB [mytest]> create table t1 (c1 int) engine=columnstore comment='schema sync only'; MariaDB [mytest]> show tables;
------------------
------------------ MariaDB [mytest]> select * from t1;
------------------
------------------ MariaDB [mytest]> drop table if exists t1; MariaDB [mytest]> show warnings;
--------
-------- MariaDB [mytest]> show tables;
------------------
------------------ | ||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-11-22 ] | ||||||||||||||||
|
I am reopening the ticket, since the warning instructs the user to restart DMLProc when DMLProc is not the issue. In this case, Columnstore table exists in the front end but not the back end. There is no data files for the requested table so file deletion is not even needed. There should not be an error deleting such files. When starting DMLProc, it would clean up orphan files if there is any, and I think that's the reason for the instruction. | ||||||||||||||||
| Comment by David Thompson (Inactive) [ 2016-11-23 ] | ||||||||||||||||
|
I believe the original case was the opposite of your case where the columnstore data files exist but calpontsys is out of sync. See David Halls comment from 10/3. What is reported is a slightly different maninfestation of the same overall issue that should also be fixed but maybe better filed as a new bug. | ||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2016-11-23 ] | ||||||||||||||||
|
Re-assigned to Ben, wasn't my ticket | ||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-11-23 ] | ||||||||||||||||
|
The situation is that the table no longer exist in the engine, but still exist in the front end schema. When dropping the table, the engine would report missing table and the drop table statement will not do anything and the table schema still exist in the front end. When trying to create the table with the same name, the create table statement would failed. If a table is missing from the system catalog, and the data files still exist, the files will be orphan files and there is no way to know what they are. In the case where errors occurred during dropping a table, restarting DMLProc will clean up the orphan files. Mr. Hall's comment on 10/4 was to simulate the table-missing-from-engine situation by deleting the table from the system catalog. I believe the fix is working as intended, and the warning is not needed. Of course, if the existing behavior is expected, then we can close the ticket. Thanks. | ||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-11-23 ] | ||||||||||||||||
|
Build verified: 1.0.5-1 mcsadmin> getsoft Name : mariadb-columnstore-platform Restested with the latest build since the last build had an issue. The group decided the existing behavior is good. Closing it. |