make sure that all data or meta written on the macro block is flushed before write create_tablet_slog

This commit is contained in:
obdev
2023-04-27 12:11:54 +00:00
committed by ob-robot
parent 764907c919
commit 56f85c9c76
2 changed files with 4 additions and 5 deletions

View File

@ -956,11 +956,6 @@ int ObLocalDevice::pwrite(
}
}
if (OB_SUCC(ret)) {
if (OB_FAIL(this->fsync_block())) {
SHARE_LOG(WARN, "fsync fail", K(ret), K(write_size), K(offset), K(size), KP(buf));
}
}
return ret;
}

View File

@ -39,6 +39,8 @@ int ObTabletSlogHelper::write_create_tablet_slog(
if (OB_UNLIKELY(!tablet_handle.is_valid())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid args", K(ret), K(tablet_handle));
} else if (OB_FAIL(THE_IO_DEVICE->fsync_block())) { // make sure that all data or meta written on the macro block is flushed
LOG_WARN("fail to fsync_block", K(ret));
} else {
ObCreateTabletLog slog_entry(tablet_handle.get_obj());
ObStorageLogParam log_param;
@ -95,6 +97,8 @@ int ObTabletSlogHelper::write_create_tablet_slog(
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(THE_IO_DEVICE->fsync_block())) { // make sure that all data or meta written on the macro block is flushed
LOG_WARN("fail to fsync_block", K(ret));
} else if (OB_FAIL(MTL(ObStorageLogger*)->write_log(param_array))) {
LOG_WARN("fail to write slog for batch creating tablet", K(ret), K(param_array));
} else {