mirror of
https://github.com/deepseek-ai/3FS
synced 2025-06-26 18:16:45 +00:00
Merge branch 'deepseek-ai:main' into main
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -11,14 +11,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Configure sccache-cache
|
||||
run: |
|
||||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
|
||||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
|
||||
|
||||
- name: Run sccache-cache
|
||||
uses: mozilla-actions/sccache-action@v0.0.4
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
sudo apt install -y cmake libuv1-dev liblz4-dev liblzma-dev libdouble-conversion-dev libdwarf-dev libunwind-dev
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace {
|
||||
auto getParser() {
|
||||
argparse::ArgumentParser parser("set-preferred-target-order");
|
||||
parser.add_argument("chainId").scan<'u', uint32_t>();
|
||||
parser.add_argument("targetIds").scan<'u', uint32_t>().remaining();
|
||||
parser.add_argument("targetIds").scan<'u', uint64_t>().remaining();
|
||||
return parser;
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ CoTryTask<Dispatcher::OutputTable> handle(IEnv &ienv,
|
||||
Dispatcher::OutputTable table;
|
||||
|
||||
auto cid = flat::ChainId(parser.get<uint32_t>("chainId"));
|
||||
auto targetIds = parser.get<std::vector<uint32_t>>("targetIds");
|
||||
auto targetIds = parser.get<std::vector<uint64_t>>("targetIds");
|
||||
auto tids = transformTo<std::vector>(std::span{targetIds.begin(), targetIds.size()},
|
||||
[](uint32_t id) { return flat::TargetId(id); });
|
||||
[](uint64_t id) { return flat::TargetId(id); });
|
||||
auto res = co_await env.mgmtdClientGetter()->setPreferredTargetOrder(env.userInfo, cid, tids);
|
||||
CO_RETURN_ON_ERROR(res);
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ CoTryTask<std::map<flat::ChainId, FileOperation::QueryResult>> FileOperation::qu
|
||||
}
|
||||
|
||||
XLOGF(ERR,
|
||||
"Failed to quertLastChunk from chain {}, err {}",
|
||||
"Failed to queryLastChunk from chain {}, err {}",
|
||||
flat::ChainId(query.routingTarget.chainId),
|
||||
result.statusCode.error());
|
||||
ADD_FAILED(queryChunksFailed, result.statusCode.error().code());
|
||||
|
||||
@@ -48,7 +48,7 @@ struct IoRingJob {
|
||||
|
||||
// we allow multiple io workers to process the same ioring, but different ranges
|
||||
// so 1 ioring can be used to submit ios processed in parallel
|
||||
// howoever, we don't allow multiple threads to prepare ios in the same ioring
|
||||
// however, we don't allow multiple threads to prepare ios in the same ioring
|
||||
// or batches may be mixed and things may get ugly
|
||||
class IoRing : public std::enable_shared_from_this<IoRing> {
|
||||
public:
|
||||
|
||||
@@ -656,22 +656,28 @@ impl Engine {
|
||||
end: impl AsRef<[u8]>,
|
||||
max_count: u64,
|
||||
) -> Result<u64> {
|
||||
let mut chunks = self.meta_store.query_chunks(begin, end, max_count)?;
|
||||
let chunks = self.meta_store.query_chunks(begin, end, max_count)?;
|
||||
let mut offset = 0;
|
||||
|
||||
const BATCH_SIZE: Size = Size::mebibyte(1);
|
||||
let mut write_batch = RocksDB::new_write_batch();
|
||||
for (chunk_id, meta) in &mut chunks {
|
||||
if write_batch.size_in_bytes() >= BATCH_SIZE.0 as usize {
|
||||
for (index, (chunk_id, meta)) in chunks.iter().enumerate() {
|
||||
if write_batch.size_in_bytes() >= BATCH_SIZE.0 as _ {
|
||||
self.meta_store.write(write_batch, true)?;
|
||||
write_batch = RocksDB::new_write_batch();
|
||||
for (chunk_id, _) in &chunks[offset..index] {
|
||||
self.meta_cache.remove(chunk_id);
|
||||
}
|
||||
offset = index;
|
||||
}
|
||||
|
||||
self.meta_store
|
||||
.remove_mut(chunk_id, meta, &mut write_batch)?;
|
||||
self.meta_cache.remove(chunk_id);
|
||||
.remove_mut(&chunk_id, &meta, &mut write_batch)?;
|
||||
}
|
||||
if !write_batch.is_empty() {
|
||||
self.meta_store.write(write_batch, true)?;
|
||||
for (chunk_id, _) in &chunks[offset..] {
|
||||
self.meta_cache.remove(chunk_id);
|
||||
}
|
||||
}
|
||||
Ok(chunks.len() as _)
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ CoTryTask<void> ResyncWorker::handleSync(VersionedChainId vChainId) {
|
||||
XLOG(CRITICAL, msg);
|
||||
|
||||
OfflineTargetReq req;
|
||||
req.targetId = targetId;
|
||||
req.targetId = target->successor->targetInfo.targetId;
|
||||
req.force = true;
|
||||
CO_RETURN_AND_LOG_ON_ERROR(co_await components_.messenger.offlineTarget(*addrResult, req, &options));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user