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

[chore](conf) Set enable_advance_next_id=true by default #44790

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,7 @@ public class Config extends ConfigBase {
"Whether to advance the ID generator after becoming Master to ensure that the id "
+ "generator will not be rolled back even when metadata is rolled back."
})
public static boolean enable_advance_next_id = false;
public static boolean enable_advance_next_id = true;

// The count threshold to do manual GC when doing checkpoint but not enough memory.
// Set zero to disable it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.analysis;

import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.UserException;
import org.apache.doris.load.ExportJob;
Expand Down Expand Up @@ -47,6 +48,12 @@ public class ExportToOutfileLogicalPlanTest extends TestWithFeService {
private String dbName = "testDb";
private String tblName = "table1";

private final boolean defaultEnableAdvanceNextId = Config.enable_advance_next_id; // backup

{
enableAdvanceNextId = false;
}

/**
* create a database and a table
*
Expand All @@ -65,6 +72,7 @@ protected void runBeforeAll() throws Exception {
+ "PARTITION p4 VALUES LESS THAN (\"50\")\n" + ")\n"
+ " distributed by hash(k1) buckets 10\n"
+ "properties(\"replication_num\" = \"1\");");
Config.enable_advance_next_id = defaultEnableAdvanceNextId; // restore
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void testFetchResult() throws AnalysisException {
Assert.assertEquals(procResult.getRows().get(3).get(5), "col_4");
Assert.assertEquals(procResult.getRows().get(3).get(11), "NGRAM_BF");
Assert.assertEquals(procResult.getRows().get(3).get(12), "ngram_bf index on col_4");
Assert.assertEquals(procResult.getRows().get(3).get(13), "(\"gram_size\" = \"3\", \"bf_size\" = \"256\")");
Assert.assertEquals(procResult.getRows().get(3).get(13), "(\"bf_size\" = \"256\", \"gram_size\" = \"3\")");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.junit.rules.ExpectedException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -231,8 +232,10 @@ public void testGetDBNames() throws Exception {
TGetDbsResult dbNames = impl.getDbNames(params);

Assert.assertEquals(dbNames.getDbs().size(), 2);
Assert.assertTrue(dbNames.getDbs().contains("test"));
Assert.assertTrue(dbNames.getDbs().contains("test_"));
List<String> expected = Arrays.asList("test", "test_");
dbNames.getDbs().sort(String::compareTo);
expected.sort(String::compareTo);
Assert.assertEquals(dbNames.getDbs(), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public abstract class TestWithFeService {
protected ConnectContext connectContext;
protected boolean needCleanDir = true;
protected int lastFeRpcPort = 0;
// make it default to enable_advance_next_id
protected boolean enableAdvanceNextId = Config.enable_advance_next_id;

protected static final String DEFAULT_CLUSTER_PREFIX = "";

Expand All @@ -152,6 +154,8 @@ public Set<Integer> getEnableNereidsRules() {

@BeforeAll
public final void beforeAll() throws Exception {
// this.enableAdvanceNextId may be reset by children classes
Config.enable_advance_next_id = this.enableAdvanceNextId;
FeConstants.enableInternalSchemaDb = false;
FeConstants.shouldCreateInternalWorkloadGroup = false;
beforeCreatingConnectContext();
Expand Down
Loading