[SERVER-35572] Always allow log archiving in WiredTiger Created: 13/Jun/18  Updated: 29/Oct/23  Resolved: 15/Jun/18

Status: Closed
Project: Core Server
Component/s: Storage, WiredTiger
Affects Version/s: None
Fix Version/s: 4.0.0-rc6, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Alexander Gorrod Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-34630 Change WiredTiger compatibility versi... Closed
is related to SERVER-29211 Change to explicitly journal a subset... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2018-06-18
Participants:

 Description   

The code handling clean shutdown with a version downgrade currently disables log archiving in WiredTiger - that causes WiredTiger to leave log files present in multiple different formats, which will lead to issues in terms of checking version compatibility when starting up databases with earlier versions of MongoDB.

The particular code in question is in WiredTigerKVEngine::cleanShutdown

The archive=false setting has been passed since the code was added. There was a conversation in the code review process, which indicates that was done to enable manual checking during development.

I think it's better to allow WiredTiger to remove the previous version log files when downgrading, so the downgrade can leave a database in a fully downgraded state.



 Comments   
Comment by Githook User [ 15/Jun/18 ]

Author:

{'username': 'dgottlieb', 'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com'}

Message: SERVER-35572: Archive WT journal files on downgrade.

(cherry picked from commit e08d0f6b6978bbdfa7f4e6fae5beb6df74b78433)
Branch: v4.0
https://github.com/mongodb/mongo/commit/5b8d340cf0877f3e5cdba76e350cdf5fb428e6de

Comment by Githook User [ 15/Jun/18 ]

Author:

{'username': 'dgottlieb', 'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com'}

Message: SERVER-35572: Archive WT journal files on downgrade.
Branch: master
https://github.com/mongodb/mongo/commit/e08d0f6b6978bbdfa7f4e6fae5beb6df74b78433

Comment by Alexander Gorrod [ 13/Jun/18 ]

daniel.gottlieb would you mind shepherding this simple change in, if you agree with it?

Comment by Alexander Gorrod [ 13/Jun/18 ]

The conversation from the code review was:

src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:427: openConfig <<
_wtOpenConfig << ",log=(archive=false)";
On 2017/07/18 11:41:24, sue wrote:
> Turning off archiving will leave V2 logs in the journal directory. All of the operations below will be
> logged at V1 and going to V1 will force a checkpoint so V2 logs won't be used if
> a crash were to happen and an old binary were run after this point. But they
> will co-exist.

I certainly needed `archive=off` as I used wt printlog to validate the tables had the right settings on. When I added that, I also
realized it may be best to keep old log entries around. I didn't even consider co-existing might be a problem, so I'm glad to hear it shouldn't be!

I believe that having co-existing versions is a problem, in that it will leave content that is newer than would be accessible using an older version of MongoDB.

Generated at Thu Feb 08 04:40:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.