[MCOL-3751] Reduce duration or type of locks held in Synchronizer class Created: 2020-01-31  Updated: 2023-11-21  Resolved: 2023-10-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: Storage Manager
Affects Version/s: 1.4.2
Fix Version/s: Icebox

Type: Task Priority: Minor
Reporter: Patrick LeBlanc (Inactive) Assignee: Leonid Fedorov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-3992 insert is too slow with S3 Closed
relates to MCOL-3745 Investigate slow-down in DDL after a ... Closed

 Description   

Followup to MCOL-3745.

Need to see if we can avoid holding a file lock for the whole duration of a sync-to-cloud op.



 Comments   
Comment by Patrick LeBlanc (Inactive) [ 2020-09-22 ]

I believe we can get pretty far on both this ticket and MCOL-3459 by using atomic-appearing writes. By writing to a uniquely-named temp file in the same location (guaranteeing that it's on the same filesystem), then renaming it when done (guaranteed by posix to be 'atomic'), no readers or writers can interfere while the write is happening. This should let us greatly reduce the use of locks across SM.

Another source of lock reduction is having writers write to unique journal files instead of having them all append to the same journal file for an object. Then, the only point of contention is on the .meta file. For this mod it may be necessary to record the journal files for each object in the .meta file.

I haven't fully explored either one of these ideas wrt SM, they are just starting points.

The key will be remembering the guarantees of the posix file i/o interface. It lets readers and writers step all over each other, it really only guarantees that it's own metadata for the file and filesystem are consistent. That's the only thing that SM needs to guarantee as well. It doesn't need to prevent the callers from doing stupid things, that's their problem.

Generated at Thu Feb 08 02:45:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.