Skip to content

Commit

Permalink
update log
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Oct 16, 2023
1 parent 3fd3ab6 commit 41471e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
16 changes: 12 additions & 4 deletions fe/fe-core/src/main/java/org/apache/doris/alter/RollupJobV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ protected void runPendingJob() throws AlterCancelException {
tbl.writeLockOrAlterCancelException();
try {
Preconditions.checkState(tbl.getState() == OlapTableState.ROLLUP);
addRollupIndexToCatalog(tbl);
addRollupIndexToCatalog(tbl, false);
} finally {
tbl.writeUnlock();
}
Expand All @@ -354,15 +354,22 @@ protected void runPendingJob() throws AlterCancelException {
LOG.info("transfer rollup job {} state to {}, watershed txn id: {}", jobId, this.jobState, watershedTxnId);
}

private void addRollupIndexToCatalog(OlapTable tbl) {
private void addRollupIndexToCatalog(OlapTable tbl, boolean replay) {
for (Partition partition : tbl.getPartitions()) {
long partitionId = partition.getId();
MaterializedIndex rollupIndex = this.partitionIdToRollupIndex.get(partitionId);
Preconditions.checkNotNull(rollupIndex);
Preconditions.checkState(rollupIndex.getState() == IndexState.SHADOW, rollupIndex.getState());
partition.createRollupIndex(rollupIndex);
}

String debugString = "";
if (this.partitionIdToRollupIndex.isEmpty() == false) {
for (MaterializedIndex rollupIdx : partitionIdToRollupIndex.values()) {
debugString = debugString + rollupIdx.toString() + "\n";
}
}
//now add some log for P0 test case, this debugString info could remove after.
LOG.info("addRollupIndexToCatalog partition end: {} ", debugString);
tbl.setIndexMeta(rollupIndexId, rollupIndexName, rollupSchema, 0 /* init schema version */,
rollupSchemaHash, rollupShortKeyColumnCount, TStorageType.COLUMN,
rollupKeysType, origStmt, analyzer != null ? new Analyzer(analyzer) : analyzer, null);
Expand Down Expand Up @@ -473,6 +480,7 @@ protected void runWaitingTxnJob() throws AlterCancelException {

List<Replica> rollupReplicas = rollupTablet.getReplicas();


for (Replica rollupReplica : rollupReplicas) {
AlterReplicaTask rollupTask = new AlterReplicaTask(rollupReplica.getBackendId(), dbId, tableId,
partitionId, rollupIndexId, baseIndexId, rollupTabletId, baseTabletId,
Expand Down Expand Up @@ -727,7 +735,7 @@ private void replayPendingJob(RollupJobV2 replayedJob) throws MetaNotFoundExcept
OlapTable olapTable = (OlapTable) db.getTableOrMetaException(tableId, Table.TableType.OLAP);
olapTable.writeLock();
try {
addRollupIndexToCatalog(olapTable);
addRollupIndexToCatalog(olapTable, true);
} finally {
olapTable.writeUnlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public void rebuildFullSchema() {
// Column maybe renamed, rebuild the column name map
indexMeta.initColumnNameMap();
}
LOG.debug("after rebuild full schema. table {}, schema size: {}", id, fullSchema.size());
LOG.info("after rebuild full schema. table {}, schema size: {}", id, fullSchema.size());
}

public boolean deleteIndexInfo(String indexName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,4 @@ suite("test_inlineview_with_window_function") {
group by ordernum
)tmp1
on tmp.ordernum=tmp1.ordernum;"""

sql """drop table if exists test_table_aaa2;"""
sql """CREATE TABLE `test_table_aaa2` (
`ordernum` varchar(65533) NOT NULL ,
`dnt` datetime NOT NULL ,
`data` json NULL
) ENGINE=OLAP
DUPLICATE KEY(`ordernum`, `dnt`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`ordernum`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);"""
sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}' ;"""
sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}' ;"""
sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}' ;"""
sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}' ;"""

}

0 comments on commit 41471e5

Please sign in to comment.