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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y cmake libuv1-dev liblz4-dev liblzma-dev libdouble-conversion-dev libdwarf-dev libunwind-dev
|
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() {
|
auto getParser() {
|
||||||
argparse::ArgumentParser parser("set-preferred-target-order");
|
argparse::ArgumentParser parser("set-preferred-target-order");
|
||||||
parser.add_argument("chainId").scan<'u', uint32_t>();
|
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;
|
return parser;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,9 +25,9 @@ CoTryTask<Dispatcher::OutputTable> handle(IEnv &ienv,
|
|||||||
Dispatcher::OutputTable table;
|
Dispatcher::OutputTable table;
|
||||||
|
|
||||||
auto cid = flat::ChainId(parser.get<uint32_t>("chainId"));
|
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()},
|
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);
|
auto res = co_await env.mgmtdClientGetter()->setPreferredTargetOrder(env.userInfo, cid, tids);
|
||||||
CO_RETURN_ON_ERROR(res);
|
CO_RETURN_ON_ERROR(res);
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ CoTryTask<std::map<flat::ChainId, FileOperation::QueryResult>> FileOperation::qu
|
|||||||
}
|
}
|
||||||
|
|
||||||
XLOGF(ERR,
|
XLOGF(ERR,
|
||||||
"Failed to quertLastChunk from chain {}, err {}",
|
"Failed to queryLastChunk from chain {}, err {}",
|
||||||
flat::ChainId(query.routingTarget.chainId),
|
flat::ChainId(query.routingTarget.chainId),
|
||||||
result.statusCode.error());
|
result.statusCode.error());
|
||||||
ADD_FAILED(queryChunksFailed, result.statusCode.error().code());
|
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
|
// 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
|
// 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
|
// or batches may be mixed and things may get ugly
|
||||||
class IoRing : public std::enable_shared_from_this<IoRing> {
|
class IoRing : public std::enable_shared_from_this<IoRing> {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -656,22 +656,28 @@ impl Engine {
|
|||||||
end: impl AsRef<[u8]>,
|
end: impl AsRef<[u8]>,
|
||||||
max_count: u64,
|
max_count: u64,
|
||||||
) -> Result<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);
|
const BATCH_SIZE: Size = Size::mebibyte(1);
|
||||||
let mut write_batch = RocksDB::new_write_batch();
|
let mut write_batch = RocksDB::new_write_batch();
|
||||||
for (chunk_id, meta) in &mut chunks {
|
for (index, (chunk_id, meta)) in chunks.iter().enumerate() {
|
||||||
if write_batch.size_in_bytes() >= BATCH_SIZE.0 as usize {
|
if write_batch.size_in_bytes() >= BATCH_SIZE.0 as _ {
|
||||||
self.meta_store.write(write_batch, true)?;
|
self.meta_store.write(write_batch, true)?;
|
||||||
write_batch = RocksDB::new_write_batch();
|
write_batch = RocksDB::new_write_batch();
|
||||||
|
for (chunk_id, _) in &chunks[offset..index] {
|
||||||
|
self.meta_cache.remove(chunk_id);
|
||||||
|
}
|
||||||
|
offset = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.meta_store
|
self.meta_store
|
||||||
.remove_mut(chunk_id, meta, &mut write_batch)?;
|
.remove_mut(&chunk_id, &meta, &mut write_batch)?;
|
||||||
self.meta_cache.remove(chunk_id);
|
|
||||||
}
|
}
|
||||||
if !write_batch.is_empty() {
|
if !write_batch.is_empty() {
|
||||||
self.meta_store.write(write_batch, true)?;
|
self.meta_store.write(write_batch, true)?;
|
||||||
|
for (chunk_id, _) in &chunks[offset..] {
|
||||||
|
self.meta_cache.remove(chunk_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(chunks.len() as _)
|
Ok(chunks.len() as _)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ CoTryTask<void> ResyncWorker::handleSync(VersionedChainId vChainId) {
|
|||||||
XLOG(CRITICAL, msg);
|
XLOG(CRITICAL, msg);
|
||||||
|
|
||||||
OfflineTargetReq req;
|
OfflineTargetReq req;
|
||||||
req.targetId = targetId;
|
req.targetId = target->successor->targetInfo.targetId;
|
||||||
req.force = true;
|
req.force = true;
|
||||||
CO_RETURN_AND_LOG_ON_ERROR(co_await components_.messenger.offlineTarget(*addrResult, req, &options));
|
CO_RETURN_AND_LOG_ON_ERROR(co_await components_.messenger.offlineTarget(*addrResult, req, &options));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user