Skip to content

Conversation

@nicktobey
Copy link
Contributor

This is the GMS side of dolthub/dolt#7634

This PR changes the engine to make it acquire a lock (provided by the storage layer) when innodb_autoinc_lock_mode is set to the "consecutive" or "traditional" values. More specifically, it calls a new function in the AutoIncrementSetter interface which optionally acquires a lock and returns a callback for releasing the lock.

The in-memory DB doesn't have multithreading support, so when just using GMS, this is a no-op. A followup PR in Dolt will update its implementation of AutoIncrementSetter to handle the locking.

… into a table with an unspecified auto-increment column, acquire a lock when the iterator is created, and release the lock when the iterator is closed.

For the in-memory db, this is a no-op because it doesn't have a lock on generating AutoIncrement values. But Dolt has its own AutoIncrement Tracker, which will supply the lock.
@nicktobey nicktobey force-pushed the nicktobey/autoinc branch from d73e043 to 325ec52 Compare April 5, 2024 23:14
@nicktobey nicktobey requested a review from zachmu April 5, 2024 23:54
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple minor comments.

@nicktobey nicktobey merged commit b53360b into main Apr 10, 2024
@nicktobey nicktobey deleted the nicktobey/autoinc branch April 10, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants