Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](Row store) get the correct value of row_store_page_size after FE restarts #38236

Merged
merged 39 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ec59d28
change default value of row_column_page_size to 16KB
lxr599 Jul 2, 2024
76a78da
allow to set row_column_page_size for tables
lxr599 Jul 4, 2024
288bf5a
[feature](Row store)allow to set row_column_page_size for tables
lxr599 Jul 4, 2024
b544145
format codes
lxr599 Jul 4, 2024
2339bd1
change default value of row_column_page_size to 16KB
lxr599 Jul 2, 2024
9a211b1
allow to set row_column_page_size for tables
lxr599 Jul 4, 2024
9552bd5
[feature](Row store)allow to set row_column_page_size for tables
lxr599 Jul 4, 2024
8c4c0f7
format codes
lxr599 Jul 4, 2024
a9e584a
rebase master
lxr599 Jul 5, 2024
eedaa21
Merge branch 'master' into page_size
lxr599 Jul 5, 2024
3f271b0
format codes
lxr599 Jul 5, 2024
843d26d
format fe codes
lxr599 Jul 5, 2024
2936a27
Merge remote-tracking branch 'upstream/master' into page_size
lxr599 Jul 8, 2024
82a3e84
Merge branch 'master' into page_size
lxr599 Jul 8, 2024
50dc477
Merge branch 'master' into page_size
lxr599 Jul 8, 2024
fe22103
display row_column_page_size only when row store enabled
lxr599 Jul 8, 2024
9706f9a
Merge branch 'master' into page_size
lxr599 Jul 10, 2024
9860a7f
add test case for property row_column_page_size
lxr599 Jul 10, 2024
29f3fd7
Merge branch 'master' into page_size
lxr599 Jul 10, 2024
78ba814
Merge branch 'apache:master' into page_size
lxr599 Jul 10, 2024
05374ba
add more test cases
lxr599 Jul 10, 2024
a607007
Merge branch 'master' into page_size
lxr599 Jul 11, 2024
c32b788
change the property name
lxr599 Jul 11, 2024
484160a
change names of vars related to row_store_page_size
lxr599 Jul 12, 2024
5c543f7
Merge remote-tracking branch 'upstream/master' into page_size
lxr599 Jul 15, 2024
617dafd
Merge branch 'master' into page_size
lxr599 Jul 16, 2024
f7d118a
Merge branch 'apache:master' into page_size
lxr599 Jul 16, 2024
e1b95e7
Merge branch 'apache:master' into page_size
lxr599 Jul 17, 2024
07beb0c
compatible with 'branch-3.0'
lxr599 Jul 17, 2024
fdb5b5a
Merge branch 'apache:master' into page_size
lxr599 Jul 23, 2024
66198ca
get the right value of page size after FE restarts
lxr599 Jul 23, 2024
167e7e9
Merge branch 'page_size' of github.com:lxr599/doris into page_size
lxr599 Jul 23, 2024
759ef99
clear debug logs
lxr599 Jul 23, 2024
cb7548e
Ensure page size is larger than 0 in BE; Add more test cases;
lxr599 Jul 23, 2024
09c384c
modify the test case of cloud mode
lxr599 Jul 23, 2024
f6cdadb
do not set page_size, use default directly
lxr599 Jul 24, 2024
4901a4f
format code
lxr599 Jul 24, 2024
26e18ac
format code...
lxr599 Jul 24, 2024
297dc77
Merge branch 'master' into page_size
lxr599 Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion be/src/olap/rowset/segment_v2/segment_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ Status SegmentWriter::_create_column_writer(uint32_t cid, const TabletColumn& co

if (column.is_row_store_column()) {
// smaller page size for row store column
opts.data_page_size = _tablet_schema->row_store_page_size();
auto page_size = _tablet_schema->row_store_page_size();
opts.data_page_size =
(page_size > 0) ? page_size : segment_v2::ROW_STORE_PAGE_SIZE_DEFAULT_VALUE;
}

std::unique_ptr<ColumnWriter> writer;
RETURN_IF_ERROR(ColumnWriter::create(opts, &column, _file_writer, &writer));
RETURN_IF_ERROR(writer->init());
Expand Down
5 changes: 4 additions & 1 deletion be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ Status VerticalSegmentWriter::_create_column_writer(uint32_t cid, const TabletCo

if (column.is_row_store_column()) {
// smaller page size for row store column
opts.data_page_size = _tablet_schema->row_store_page_size();
auto page_size = _tablet_schema->row_store_page_size();
opts.data_page_size =
(page_size > 0) ? page_size : segment_v2::ROW_STORE_PAGE_SIZE_DEFAULT_VALUE;
}

std::unique_ptr<ColumnWriter> writer;
RETURN_IF_ERROR(ColumnWriter::create(opts, &column, _file_writer, &writer));
RETURN_IF_ERROR(writer->init());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ public void gsonPostProcess() throws IOException {
buildEnableLightSchemaChange();
buildStoreRowColumn();
buildRowStoreColumns();
buildRowStorePageSize();
buildSkipWriteIndexOnLoad();
buildCompactionPolicy();
buildTimeSeriesCompactionGoalSizeMbytes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected Partition createPartitionWithIndices(long dbId, OlapTable tbl, long pa
IdGeneratorBuffer idGeneratorBuffer,
BinlogConfig binlogConfig,
boolean isStorageMediumSpecified,
List<Integer> clusterKeyIndexes, long pageSize)
List<Integer> clusterKeyIndexes)
throws DdlException {
// create base index first.
Preconditions.checkArgument(tbl.getBaseIndexId() != -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class PropertyAnalyzer {

// row store page size, default 16KB
public static final String PROPERTIES_ROW_STORE_PAGE_SIZE = "row_store_page_size";
public static final long ROW_STORE_PAGE_SIZE_DEFAULT_VALUE = 16384;
public static final long ROW_STORE_PAGE_SIZE_DEFAULT_VALUE = 16384L;

public static final String PROPERTIES_ENABLE_LIGHT_SCHEMA_CHANGE = "light_schema_change";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ public PartitionPersistInfo addPartition(Database db, String tableName, AddParti
singlePartitionDesc.isInMemory(),
singlePartitionDesc.getTabletType(),
storagePolicy, idGeneratorBuffer,
binlogConfig, dataProperty.isStorageMediumSpecified(), null, olapTable.rowStorePageSize());
binlogConfig, dataProperty.isStorageMediumSpecified(), null);
// TODO cluster key ids

// check again
Expand Down Expand Up @@ -2006,7 +2006,7 @@ protected Partition createPartitionWithIndices(long dbId, OlapTable tbl, long pa
IdGeneratorBuffer idGeneratorBuffer,
BinlogConfig binlogConfig,
boolean isStorageMediumSpecified,
List<Integer> clusterKeyIndexes, long rowStorePageSize)
List<Integer> clusterKeyIndexes)
throws DdlException {
// create base index first.
Preconditions.checkArgument(tbl.getBaseIndexId() != -1);
Expand Down Expand Up @@ -2090,7 +2090,7 @@ protected Partition createPartitionWithIndices(long dbId, OlapTable tbl, long pa
tbl.getTimeSeriesCompactionLevelThreshold(),
tbl.storeRowColumn(), binlogConfig,
tbl.getRowStoreColumnsUniqueIds(rowStoreColumns),
objectPool, rowStorePageSize);
objectPool, tbl.rowStorePageSize());

task.setStorageFormat(tbl.getStorageFormat());
task.setInvertedIndexFileStorageFormat(tbl.getInvertedIndexFileStorageFormat());
Expand Down Expand Up @@ -2881,7 +2881,7 @@ private boolean createOlapTable(Database db, CreateTableStmt stmt) throws UserEx
idGeneratorBuffer,
binlogConfigForTask,
partitionInfo.getDataProperty(partitionId).isStorageMediumSpecified(),
keysDesc.getClusterKeysColumnIds(), olapTable.rowStorePageSize());
keysDesc.getClusterKeysColumnIds());
afterCreatePartitions(db.getId(), olapTable.getId(), null,
olapTable.getIndexIdList(), true);
olapTable.addPartition(partition);
Expand Down Expand Up @@ -2964,7 +2964,7 @@ private boolean createOlapTable(Database db, CreateTableStmt stmt) throws UserEx
partionStoragePolicy, idGeneratorBuffer,
binlogConfigForTask,
dataProperty.isStorageMediumSpecified(),
keysDesc.getClusterKeysColumnIds(), olapTable.rowStorePageSize());
keysDesc.getClusterKeysColumnIds());
olapTable.addPartition(partition);
olapTable.getPartitionInfo().getDataProperty(partition.getId())
.setStoragePolicy(partionStoragePolicy);
Expand Down Expand Up @@ -3431,7 +3431,7 @@ public void truncateTable(TruncateTableStmt truncateTableStmt) throws DdlExcepti
olapTable.getPartitionInfo().getDataProperty(oldPartitionId).getStoragePolicy(),
idGeneratorBuffer, binlogConfig,
copiedTbl.getPartitionInfo().getDataProperty(oldPartitionId).isStorageMediumSpecified(),
clusterKeyIdxes, olapTable.rowStorePageSize());
clusterKeyIdxes);
newPartitions.add(newPartition);
}

Expand Down
2 changes: 1 addition & 1 deletion gensrc/thrift/AgentService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct TTabletSchema {
19: optional list<i32> cluster_key_idxes
// col unique id for row store column
20: optional list<i32> row_store_col_cids
21: optional i64 row_store_page_size = 16384;
21: optional i64 row_store_page_size = 16384
}

// this enum stands for different storage format in src_backends
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select_star --
1 1 1 a

-- !select_star --
3 3 \N c

-- !select_star --
1 1 1 a

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import org.codehaus.groovy.runtime.IOGroovyMethods

suite ("test_row_store_page_size_cloud") {

sql """ DROP TABLE IF EXISTS ps_table_1; """

sql """
create table ps_table_1(
k1 int not null,
k2 int not null,
k3 bigint null,
k4 varchar(100) null
)
unique key (k1,k2)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1", "store_row_column" = "true");
"""

test {
sql "show create table ps_table_1;"
check { result, exception, startTime, endTime ->
assertTrue(result[0][1].contains("\"row_store_page_size\" = \"16384\""))
}
}

sql "insert into ps_table_1 select 1,1,1,'a';"
sql "insert into ps_table_1 select 2,2,2,'b';"
sql "insert into ps_table_1 select 3,3,null,'c';"

explain {
sql("select * from ps_table_1 where k1=1 and k2=1;")
contains("SHORT")
}

qt_select_star "select * from ps_table_1 where k1=1 and k2=1;"
qt_select_star "select * from ps_table_1 where k1=3 and k2=3;"

sql """ DROP TABLE IF EXISTS ps_table_1; """

sql """ DROP TABLE IF EXISTS ps_table_2; """

sql """
create table ps_table_2(
k1 int not null,
k2 int not null,
k3 bigint null,
k4 varchar(100) null
)
unique key (k1,k2)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1", "store_row_column" = "true", "row_store_page_size" = "8190");
"""

test {
sql "show create table ps_table_2;"
check { result, exception, startTime, endTime ->
assertTrue(result[0][1].contains("\"row_store_page_size\" = \"8192\""))
}
}

sql "insert into ps_table_2 select 1,1,1,'a';"
sql "insert into ps_table_2 select 2,2,2,'b';"
sql "insert into ps_table_2 select 3,3,null,'c';"

explain {
sql("select * from ps_table_2 where k1=1 and k2=1;")
contains("SHORT")
}

qt_select_star "select * from ps_table_2 where k1=1 and k2=1;"

sql """ DROP TABLE IF EXISTS ps_table_2; """
}
Loading