-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support read-only mode #21
Comments
This involves more than opening the db file(s) in read-only mode. Log files cannot be deleted/created, the info file cannot be overwritten, the lock file cannot be created. Checkpoints are disabled and recovery must not checkpoint either. Snapshots don't create a temp database. Should in-memory changes be allowed, but just not be writable? This isn't a true read-only mode, but instead, a non-persistable mode. Like a non-durable database, the cache can become exhausted. |
for Supporting ReadOnly mode, is it necessary to create a new PagedDB subClass which provides the functionality of reading values from DB, but disable all the writing functions inside ? Or we reuse the DurablePageDb class and check the readOnly mode inside to perform the operations ? |
If we use the NoPagedBd class, then I think it's the same as allowing in-memory changes. |
I think the mode should be "fileReadOnly(true)", and allow changes to made in-memory. The PageArray is opened in read-only mode, preventing writes. New checks are required for providing better exceptions. |
I've been modifying in my fork for readOnly in a lot fields, I found that multiple choices are available for supporting readOnly. For instance, RedoWriter, in my perspective, since ReadOnly mode will not allow RedoLog/UndoLog creation, one possible way to do it is to create a DummyRedoWriter, which inside, write. checkpoint functions will just pass and do nothing. Another way is to throw ReadOnlyModeException during certain API call, like someone wants to call checkpoint on Database class. Are these two ways all acceptable ? |
Another question is for Snapshot function. If snapshot isn't allowed to create TempDatabase, then how can we do it ? Directly snapshot to memory only ? |
No description provided.
The text was updated successfully, but these errors were encountered: