Skip to content

Commit 30eb1a5

Browse files
committed
MDEV-39861 innodb_log_recovery_target wrongly opens log in read-write mode
log_t::archived_switch_recovery_prepare(): Observe recv_sys.rpo similar to what recv_sys_t::find_checkpoint() does.
1 parent 09b9772 commit 30eb1a5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

storage/innobase/log/log0recv.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3768,7 +3768,8 @@ bool log_t::archived_switch_recovery_prepare(lsn_t lsn) noexcept
37683768
static_assert(int{READ_WRITE} == 0, "");
37693769
static_assert(int{READ_ONLY} == 1, "");
37703770
resize_log.m_file= os_file_create_func(fn, OS_FILE_OPEN, OS_LOG_FILE,
3771-
int{i->second.access} > 0, &success);
3771+
i->second.access > 0 || recv_sys.rpo,
3772+
&success);
37723773
ut_ad(success == (resize_log.m_file != OS_FILE_CLOSED));
37733774
if (resize_log.m_file == OS_FILE_CLOSED)
37743775
{

0 commit comments

Comments
 (0)