Skip to content

Fdblocking3#5754

Closed
dorinhogea wants to merge 6 commits intobloomberg:mainfrom
dorinhogea:fdblocking3
Closed

Fdblocking3#5754
dorinhogea wants to merge 6 commits intobloomberg:mainfrom
dorinhogea:fdblocking3

Conversation

@dorinhogea
Copy link
Contributor

trying to get regressions run here

Idea is to use short term mutexes to protect arrays and hashes, and long term read locks for
fdb and table read access.

There is a live read/write for each fdb object.  As long as there is a pointer to fdb, a read lock
is acquired for that fdb.
Each remote table is protected by its own long term read lock (similar to a table lock).

There are two intervals when both table locks and fdb live lock are acquired:
1) during query preparing, if remote table discovery is needed, when we retrieve and attach remote tables;
these locks are released once setup is done; the sqlite_stat tables are also locked during this phase
2) during query execution; we get an fdb live lock and table locks for each remote table locked, and we
release them when unlocking the remote table

Updating a table requires an exclusive lock on that table; to avoid blocking for long duration when a remote
table is schema changed, we use a mvcc scheme that COW new table objects and detects readers using trywrlock.
Last reader of a stable table will free that object.

Signed-off-by: Dorin Hogea <dhogea@bloomberg.net>
Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

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

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
commit_lsn_map
consumer_non_atomic_default_consumer_generated
fdb_compat_rte_connect_generated
fdb_push_rte_connect_generated
fdb_push_redirect_generated
fdb_push
fdb_compat
simple_remsql_whitelist_generated
simple_remsql_rte_connect_generated
simple_remsql_fdbpushredirect_generated

Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

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

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
silogdel [core dumped]
sc_truncate_multiddl_generated
consumer_non_atomic_default_consumer_generated
sc_transactional_rowlocks_generated
fdb_compat_rte_connect_generated
fdb_compat
fdb_push_rte_connect_generated
fdb_push_redirect_generated
fdb_push
reco-ddlk-sql

@dorinhogea dorinhogea closed this Feb 25, 2026
@dorinhogea dorinhogea deleted the fdblocking3 branch February 25, 2026 03:33
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