[MCOL-1077] Two applications using Bulk Insert API Created: 2017-12-04 Updated: 2023-10-26 Resolved: 2018-07-20 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.1.2, 1.1.6 |
| Fix Version/s: | 1.1.3 |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Sasha V | Assignee: | Andrew Hutchings (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Multi-server ColumnStore instance |
||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
Thank you for releasing Bulk Insert API that enable applications to stream data remotely to the ColumnStore nodes. By their nature, data streaming applications run continuously. Redundant applications could increase data streaming uptime, since if one application fails, a second application would still be running. For such redundancy, I would like to run two applications that write to the same table from remote hosts. Applications alternate holding the table write lock in a following sequence: The first application:
The second application:
Then first application gets the table lock, and so on. Could the Bulk Insert API be extended with a call to check if the table is currently locked? |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2017-12-05 ] | ||||||||||||||||||||||||||||||||||||||||||
|
This can be done, but in your scenario there could be a race which would probably need to be accounted for: 1. app 1 checks the lock, sees nothing In this scenario you could catch the failure at 4 for the same effect. I think there is a bug where 4 isn't happening though but I've hit another issue too. I'll file some bugs around this. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-10 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hi linuxjedi, Thank you for fixing the
Hopefully, in case of an unexpected failure of the Application 1, the table lock will be released. In that case, the Application 2 gets the table lock and continues data streaming that was interrupted due to the Application 1 failure. How can I assure that the table lock will be released upon the failure of the Application 1? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-12-10 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hi, The table lock will be automatically released if the ColumnStoreBulkInsert is object is deleted (or on commit/rollback). If your application crashes or ends before that happens the lock will remain and will need to be removed with viewTableLock/clearTableLock. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-11 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Hi linuxjedi Could the Bulk Insert API be extended with the (remote) viewTableLock/clearTableLock functionality then? | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-12-11 ] | ||||||||||||||||||||||||||||||||||||||||||
|
It is possible. I have created | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-12 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Should the Bulk Insert API be extended with the (remote) print transactions functionality as well? After several tests that kill my Bulk Write SDK applications with various signals, I ended up with the MariaDB ColumnStore system that has no table locks, but has active transactions reported by the shutdown command:
while the rollback -p command does not print any transactions and there is no file /usr/local/mariadb/columnstore/data1/systemFiles/dataTransaction | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-12-12 ] | ||||||||||||||||||||||||||||||||||||||||||
|
This message also appears if the DBRM is locked for some reason. I think it very unlikely that a transaction could exist without a lock. It could be that killing the API caused some other behaviour problem we haven't seen before. This would likely be observable in ColumnStore's err.log. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-12 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Upon handling kill signals, my Bulk Insert API application calls the rollback(). This call logs the following in /var/log/mariadb/columnstore/info.log
Similar lines are logged upon executing the clearTableLock command:
However these are preceded and followed by extra lines, which as absent in case of the BatchInsert. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-12 ] | ||||||||||||||||||||||||||||||||||||||||||
|
For some reasons that are not clear to me, my test MariaDB ColumnStore instance has no err.log file:
| ||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-12-12 ] | ||||||||||||||||||||||||||||||||||||||||||
|
The two extra lines are actually logged by the "cleartablelock" command (hence the different process ID in the square braces). The API uses the same calls as cleartablelock when executing a rollback. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2017-12-13 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I reproduced the issue with basic_bulk_insert example as described in | ||||||||||||||||||||||||||||||||||||||||||
| Comment by David Thompson (Inactive) [ 2018-07-20 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Closing this as i think the fix to | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sasha V [ 2018-09-17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Alas, the problem is not fully resolved. Here is my test sequence: 1) On one Ubuntu 18.04 docker node I installed ColumnStore server 1.1.6 postConfigured as a multi-server (with a single node). I modified the basic_bulk_insert.cpp adding the sleep(10) equivalent by adding three lines as shown below:
Then launched the "sleeping" basic_bulk_insert and terminated this process with kill -9.
Also the second (original) basic_bulk_insert attempt resulted in
As Andrew directed above, I cleared this lock on the server side with:
After clearing the lock, the (original) basic_bulk_insert attempt was successful. Unfortunately, the problem reported above, remains.
As earlier, the rollback -p command does not print any transactions and there is no file /usr/local/mariadb/columnstore/data1/systemFiles/dataTransaction | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-09-17 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Actually what you are describing here is more like |