[SERVER-64752] Does WT metadata change when closing a readonly WT_CONNECTION? Created: 21/Mar/22 Updated: 29/Oct/23 Resolved: 21/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc0 |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | shard-merge-milestone-1 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
When we started implementing PM-2353, Dan Gottlieb provided this helpful sketch that shows how to import MongoDB collections from a directory full of WT files. It follows these steps: 1. Call wiredtiger_open on the directory of WT files Dan asked, regarding step 3:
Could a WiredTiger expert answer his question? |
| Comments |
| Comment by Keith Smith [ 29/Mar/22 ] |
|
jesse, your guess is correct. WiredTiger doesn't perform rollback-to-stable on a readonly connection. |
| Comment by A. Jesse Jiryu Davis [ 29/Mar/22 ] |
|
keith.smith late-breaking question about this: Does WT execute rollback-to-stable if we open a WT database in readonly mode? If so we could call wiredtiger_open just once. But I'm guessing the answer is "no", since rollback-to-stable would seem to violate the "readonly" contract. |
| Comment by A. Jesse Jiryu Davis [ 21/Mar/22 ] |
|
Let's follow Keith's suggestion. Even if our current code is safe, it relies on WT internals instead of the WT API. It's more future-proof to close and reopen with "readonly=true". |
| Comment by Keith Smith [ 21/Mar/22 ] |
|
Dan G is correct that WT will take a checkpoint at connection close. Normally we skip checkpoint on a file if no data has changed. I'm not sure offhand whether the checkpoint at close behaves the same way. I will look into that. Regardless of the answer, an alternative that would certainly work would be to reopen the connection readonly after step #1. I.e., expand #1 to:
|