Skip to content

Ufid handle - #6367

Open
akshatsikarwar wants to merge 2 commits into
bloomberg:mainfrom
akshatsikarwar:ufid-handle
Open

akshatsikarwar wants to merge 2 commits into
bloomberg:mainfrom
akshatsikarwar:ufid-handle

Conversation

@akshatsikarwar

Copy link
Copy Markdown
Contributor

No description provided.

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

The first 10 failing tests are:
incoherent_slow **quarantined**
reco-ddlk-sql **quarantined**
consumer_non_atomic_default_consumer_generated **quarantined**

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

The first 10 failing tests are:
constraints_partial_index_off_generated [failed with core dumped]
constraints [failed with core dumped]
sqlqueries
tunables
sc_truncate_lockorder_generated [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**
skipscan [timeout] **quarantined**

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cbuild submission: Success ✓.
Regression testing: 0/758 tests failed ⚠.

The first 10 failing tests are:
reco-ddlk-sql [timeout] **quarantined**

The ufid hash holds one handle per file. Recovery and replication can open
several DB_AM_RECOVER handles for the same file: __ufid_open handles taken
while applying ufid-logged records, handles dbreg opens during recovery
(e.g. after verify-match on a master swing), and handles registered when a
replicant becomes master. When a newer handle is registered,
__ufid_add_dbp drops the older one from the hash and nothing closes it.

Two leaks follow:

- __db_clear_ufid_hash (TRUNCATE, or an alter that rebuilds files) closes
  only the handle currently in the hash. Dropped handles keep the retired
  btree files open, so delfiles fails or the unlinked files keep using
  disk space until the process restarts.
- __ufid_open handles have no owner other than the hash, so a clean exit
  fails with "Database handles open during environment close".

Every DB_AM_RECOVER handle goes through __ufid_add_dbp when it opens and
stays on dbenv->dblist until it closes. So instead of tracking dropped
handles, __db_close_recover_dbps walks the dblist and closes every
recovery handle for a fileid, or for all files. __db_clear_ufid_hash uses
it for the retired file, and __dbenv_close uses it for all files after
dbreg has closed its own handles.

Add ufid_handle_leak and ufid_deleted_file_leak cluster tests.

Signed-off-by: Akshat Sikarwar <asikarwar1@bloomberg.net>
ufid_recovery, ufid_reopen and dbreg_race ran /opt/bb/bin/cdb2sql over ssh,
and catchup restarted a node with /opt/bb/bin/comdb2, so they failed on
clusters without an installed comdb2. Use CDB2SQL_EXE and COMDB2_EXE, which
setup already relies on being present at the same path on every node.

Signed-off-by: Akshat Sikarwar <asikarwar1@bloomberg.net>

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

The first 10 failing tests are:
nowritetimeout

This branch has not been deployed

No deployments
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