Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add db_journal_mode trait to FileIdManager classes #61

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

kevin-bates
Copy link
Member

This pull request adds the ability for operators/admins to set the journal mode of the underlying SQLite database. Because FileID Manager classes have different characteristics, the default db_journal_mode for the ArbitraryFileIdManager will be DELETE (which is the SQLite default), while the default for LocalFileIdManager will be WAL since its more performant from a multi-threaded standpoint - although not supported on NFS-mounted filesystems. Because the default FileID Manager is ArbitraryFileIdManager, environments configured on NFS-mounted filesystems should now work out-of-the-box.

Operators can use the db_journal_mode trait to set it to any valid value depending on their needs. The set of valid values are {"DELETE", "TRUNCATE", "PERSIST", "MEMORY", "WAL", "OFF"}.

The informational message indicating tables and indices will be created is also extended to include the journal mode setting:

[I 2023-02-22 16:37:48.496 FileIdExtension] ArbitraryFileIdManager : Creating File ID tables and indices with journal_mode = DELETE

Resolves: #60

@kevin-bates kevin-bates added the enhancement New feature or request label Feb 23, 2023
@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Base: 85.65% // Head: 86.03% // Increases project coverage by +0.37% 🎉

Coverage data is based on head (c0f61fe) compared to base (99c1830).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
+ Coverage   85.65%   86.03%   +0.37%     
==========================================
  Files           5        5              
  Lines         523      537      +14     
  Branches       68       69       +1     
==========================================
+ Hits          448      462      +14     
  Misses         53       53              
  Partials       22       22              
Impacted Files Coverage Δ
jupyter_server_fileid/manager.py 90.79% <100.00%> (+0.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dlqqq dlqqq merged commit 542cceb into jupyter-server:main Feb 23, 2023
@dlqqq
Copy link
Collaborator

dlqqq commented Feb 23, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using sqlite in WAL mode causes file saving failure when used on JupyterHub on NFS
2 participants