Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
meegoo committed Nov 7, 2024
1 parent 4593ce0 commit 95f745d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 176 deletions.
6 changes: 1 addition & 5 deletions be/src/storage/delta_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,11 @@ class DeltaWriter {
// [NOT thread-safe]
[[nodiscard]] Status commit();

<<<<<<< HEAD
[[nodiscard]] Status flush_memtable_async(bool eos = false);
=======

// Manual flush used by stale memtable flush
Status manual_flush();

Status flush_memtable_async(bool eos = false);
>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))

// Rollback all writes and delete the Rowset created by 'commit()', if any.
// [thread-safe]
//
Expand Down
25 changes: 1 addition & 24 deletions be/src/storage/lake/async_delta_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,32 +124,9 @@ inline int AsyncDeltaWriterImpl::execute(void* meta, bthread::TaskIterator<Async
LOG_IF(ERROR, !st.ok()) << "Fail to write. tablet_id: " << delta_writer->tablet_id()
<< " txn_id: " << delta_writer->txn_id() << ": " << st;
}
<<<<<<< HEAD
if (st.ok() && iter->flush_after_write) {
flush_after_write = true;
continue;
=======
case kFlushTask: {
auto flush_task = std::static_pointer_cast<FlushTask>(task_ptr);
if (st.ok()) {
st.update(delta_writer->manual_flush());
}
flush_task->cb(st);
break;
}
case kFinishTask: {
auto finish_task = std::static_pointer_cast<FinishTask>(task_ptr);
if (st.ok()) {
auto res = delta_writer->finish_with_txnlog(finish_task->finish_mode);
st.update(res.status());
LOG_IF(ERROR, !st.ok()) << "Fail to finish write. tablet_id: " << delta_writer->tablet_id()
<< " txn_id: " << delta_writer->txn_id() << ": " << st;
finish_task->cb(std::move(res));
} else {
finish_task->cb(st);
}
break;
>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
}
if (st.ok() && iter->finish_after_write) {
st = delta_writer->finish();
Expand All @@ -159,7 +136,7 @@ inline int AsyncDeltaWriterImpl::execute(void* meta, bthread::TaskIterator<Async
iter->cb(st);
}
if (flush_after_write) {
st = delta_writer->flush_async();
st = delta_writer->manual_flush();
LOG_IF(ERROR, !st.ok()) << "Fail to flush. tablet_id: " << delta_writer->tablet_id()
<< " txn_id: " << delta_writer->txn_id() << ": " << st;
}
Expand Down
3 changes: 0 additions & 3 deletions be/test/storage/lake/async_delta_writer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ TEST_F(LakeAsyncDeltaWriterTest, test_concurrent_write_and_close) {
SyncPoint::GetInstance()->DisableProcessing();
}

<<<<<<< HEAD
=======
TEST_F(LakeAsyncDeltaWriterTest, test_flush) {
// Prepare data for writing
static const int kChunkSize = 128;
Expand Down Expand Up @@ -558,5 +556,4 @@ TEST_F(LakeAsyncDeltaWriterTest, test_flush) {
delta_writer->close();
}

>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
} // namespace starrocks::lake
130 changes: 0 additions & 130 deletions test/sql/test_automatic_bucket/R/test_automatic_partition
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ PROPERTIES (
);
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_invalid_bucket_size
create table t0(k int) properties('bucket_size'='0');
-- result:
Expand All @@ -68,16 +58,6 @@ alter table t set('bucket_size'='2048');
-- result:
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_automatic_bucket
create database kkk;
-- result:
Expand Down Expand Up @@ -110,16 +90,6 @@ alter table t set('bucket_size'='1');
-- result:
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_range_partition @sequential
create database ttt;
-- result:
Expand Down Expand Up @@ -179,16 +149,6 @@ select * from t;
2021-01-05 1
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_list_partition @sequential
create database ddd;
-- result:
Expand Down Expand Up @@ -248,16 +208,6 @@ select * from t;
2021-01-03 1
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_expr_partition @sequential
create database eee;
-- result:
Expand Down Expand Up @@ -312,16 +262,6 @@ select * from t;
2021-01-01 1
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_schema_change @sequential
create table t(k date, v int) DUPLICATE KEY(k) PARTITION BY DATE_TRUNC('DAY', `k`)
PROPERTIES (
Expand Down Expand Up @@ -426,16 +366,6 @@ select * from t;
2021-01-05 None 2
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_mv @sequential
create table t(k date, v int, v1 int) DUPLICATE KEY(k) PARTITION BY DATE_TRUNC('DAY', `k`)
PROPERTIES (
Expand Down Expand Up @@ -518,16 +448,6 @@ select k, v1 from t;
2021-01-03 2
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_delete
create table t(k int, v int)
PROPERTIES (
Expand Down Expand Up @@ -566,16 +486,6 @@ select * from t;
-- result:
-- !result

<<<<<<< HEAD
=======







>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
-- name: test_mutable_bucket @sequential
create database ggg;
-- result:
Expand Down Expand Up @@ -661,45 +571,6 @@ alter table t set('mutable_bucket_num'='a');
-- result:
E: (5064, 'Getting analyzing error. Detail message: Mutable bucket num: For input string: "a".')
-- !result
<<<<<<< HEAD
=======





-- name: test_tablet_check
create table t(k int)properties('bucket_size'='1');
-- result:
-- !result
insert into t values(1);
-- result:
-- !result
insert into t values(1);
-- result:
-- !result
insert into t values(1);
-- result:
-- !result
admin set frontend config('consistency_tablet_meta_check_interval_ms'='100');
-- result:
-- !result
select sleep(5);
-- result:
1
-- !result
select * from t;
-- result:
1
1
1
-- !result
admin set frontend config('consistency_tablet_meta_check_interval_ms'='7200000');
-- result:
-- !result




-- name: test_stale_flush @sequential
create table t(k int)properties('bucket_size'='1');
Expand All @@ -714,4 +585,3 @@ insert into t select generate_series from TABLE(generate_series(1, 10000000));
update information_schema.be_configs set value=104857600 where name='write_buffer_size';
-- result:
-- !result
>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))
14 changes: 0 additions & 14 deletions test/sql/test_automatic_bucket/T/test_automatic_partition
Original file line number Diff line number Diff line change
Expand Up @@ -182,24 +182,10 @@ select count(*) from information_schema.be_tablets t1, information_schema.tables
select * from t;

alter table t set('mutable_bucket_num'='-1');
<<<<<<< HEAD
alter table t set('mutable_bucket_num'='a');
=======
alter table t set('mutable_bucket_num'='a');

-- name: test_tablet_check
create table t(k int)properties('bucket_size'='1');
insert into t values(1);
insert into t values(1);
insert into t values(1);
admin set frontend config('consistency_tablet_meta_check_interval_ms'='100');
select sleep(5);
select * from t;
admin set frontend config('consistency_tablet_meta_check_interval_ms'='7200000');

-- name: test_stale_flush @sequential
create table t(k int)properties('bucket_size'='1');
update information_schema.be_configs set value=102400 where name='write_buffer_size';
insert into t select generate_series from TABLE(generate_series(1, 10000000));
update information_schema.be_configs set value=104857600 where name='write_buffer_size';
>>>>>>> 2ec626ec6a ([BugFix] Fix stale mem flush not reduce load memory usage (#52613))

0 comments on commit 95f745d

Please sign in to comment.