Skip to content

对于读存在提交版本和缓存版本的疑问 #246

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

Open
shuiyihang opened this issue Apr 18, 2025 · 0 comments
Open

对于读存在提交版本和缓存版本的疑问 #246

shuiyihang opened this issue Apr 18, 2025 · 0 comments

Comments

@shuiyihang
Copy link

你好,我看设计笔记里提到: When there are both committed and pending versions, the service replies a special status code to notify the client.
和这部分代码
Result<Void> StorageTarget::aioPrepareRead(AioReadJob &job) { readCountPerDisk_->addSample(1); readBytesPerDisk_->addSample(job.alignedLength()); if (useChunkEngine()) { return ChunkEngine::aioPrepareRead(*engine_, job); } else { return ChunkReplica::aioPrepareRead(chunkStore_, job); } }
但是我发现使用脚本生成的创建目标的txt文件中内容是:
create-target --node-id 10002 --disk-index 0 --target-id 1001000200102 --chain-id 1000100003 --use-new-chunk-engine
也就是说targetConfig.only_chunk_engine被设置为true,并序列化保存成一个toml文件,以后都会加载only_chunk_engine为true.
但是我在ChunkEngine::aioPrepareRead中并没有看到类似如下版本号对比的处理:
if (UNLIKELY(result.commitVer != result.updateVer && !state.readUncommitted)) { auto msg = fmt::format("chunk {} {} version mismatch {} != {}", chunkId, meta, result.commitVer, result.updateVer); XLOG(ERR, msg); storageReadUncommitted.addSample(1); return makeError(StorageCode::kChunkNotCommit, std::move(msg)); }
请问是我看的逻辑有遗漏吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant