diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8dc4b62..77a5989 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/src/client/cli/admin/SetPreferredTargetOrder.cc b/src/client/cli/admin/SetPreferredTargetOrder.cc index a93b59c..738a45b 100644 --- a/src/client/cli/admin/SetPreferredTargetOrder.cc +++ b/src/client/cli/admin/SetPreferredTargetOrder.cc @@ -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 handle(IEnv &ienv, Dispatcher::OutputTable table; auto cid = flat::ChainId(parser.get("chainId")); - auto targetIds = parser.get>("targetIds"); + auto targetIds = parser.get>("targetIds"); auto tids = transformTo(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); diff --git a/src/fbs/meta/FileOperation.cc b/src/fbs/meta/FileOperation.cc index 9d5ef0b..f21b81a 100644 --- a/src/fbs/meta/FileOperation.cc +++ b/src/fbs/meta/FileOperation.cc @@ -132,7 +132,7 @@ CoTryTask> 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()); diff --git a/src/fuse/IoRing.h b/src/fuse/IoRing.h index 32a1237..b7d022c 100644 --- a/src/fuse/IoRing.h +++ b/src/fuse/IoRing.h @@ -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 { public: diff --git a/src/storage/chunk_engine/src/core/engine.rs b/src/storage/chunk_engine/src/core/engine.rs index 96e33a4..b015761 100644 --- a/src/storage/chunk_engine/src/core/engine.rs +++ b/src/storage/chunk_engine/src/core/engine.rs @@ -656,22 +656,28 @@ impl Engine { end: impl AsRef<[u8]>, max_count: u64, ) -> Result { - 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 _) } diff --git a/src/storage/sync/ResyncWorker.cc b/src/storage/sync/ResyncWorker.cc index fb73299..27d021a 100644 --- a/src/storage/sync/ResyncWorker.cc +++ b/src/storage/sync/ResyncWorker.cc @@ -279,7 +279,7 @@ CoTryTask 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));