Skip to content

Commit

Permalink
Merge pull request #8979 from zhyass/feature_update
Browse files Browse the repository at this point in the history
fix(storage): compact oom and write not retried
  • Loading branch information
BohuTANG authored Nov 26, 2022
2 parents 3b78720 + b3d3bda commit 76b7dea
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use opendal::Operator;
use super::compact_meta::CompactSourceMeta;
use super::compact_part::CompactTask;
use super::CompactSinkMeta;
use crate::io::write_data;
use crate::io::BlockReader;
use crate::io::TableMetaLocationGenerator;
use crate::operations::mutation::AbortOperation;
Expand Down Expand Up @@ -111,7 +112,7 @@ impl CompactTransform {
thresholds: BlockCompactThresholds,
) -> Result<ProcessorPtr> {
let settings = ctx.get_settings();
let max_memory_usage = settings.get_max_memory_usage()?;
let max_memory_usage = (settings.get_max_memory_usage()? as f64 * 0.95) as u64;
let max_threads = settings.get_max_threads()?;
let max_memory = max_memory_usage / max_threads;
Ok(ProcessorPtr::create(Box::new(CompactTransform {
Expand Down Expand Up @@ -361,13 +362,9 @@ impl Processor for CompactTransform {
while let Some(state) = serialize_states.pop() {
handles.push(async move {
// write block data.
dal.object(&state.block_location)
.write(state.block_data)
.await?;
write_data(&state.block_data, dal, &state.block_location).await?;
// write index data.
dal.object(&state.index_location)
.write(state.index_data)
.await
write_data(&state.index_data, dal, &state.index_location).await
});
}
futures::future::try_join_all(handles).await?;
Expand Down

1 comment on commit 76b7dea

@vercel
Copy link

@vercel vercel bot commented on 76b7dea Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend-git-main-databend.vercel.app
databend.rs
databend.vercel.app
databend-databend.vercel.app

Please sign in to comment.