go/libraries/doltcore/sqle/dprocedures: Do not register dolt_gc.

This commit is contained in:
Aaron Son
2023-01-31 14:23:40 -08:00
parent bb1d211819
commit de9892237e
4 changed files with 55 additions and 45 deletions

View File

@@ -31,7 +31,10 @@ var DoltProcedures = []sql.ExternalStoredProcedureDetails{
{Name: "dolt_commit_hash_out", Schema: stringSchema("hash"), Function: doltCommitHashOut},
{Name: "dolt_conflicts_resolve", Schema: int64Schema("status"), Function: doltConflictsResolve},
{Name: "dolt_fetch", Schema: int64Schema("success"), Function: doltFetch},
{Name: "dolt_gc", Schema: int64Schema("success"), Function: doltGC},
// dolt_gc is disabled for now.
// {Name: "dolt_gc", Schema: int64Schema("success"), Function: doltGC},
{Name: "dolt_merge", Schema: int64Schema("fast_forward", "conflicts"), Function: doltMerge},
{Name: "dolt_pull", Schema: int64Schema("fast_forward", "conflicts"), Function: doltPull},
{Name: "dolt_push", Schema: int64Schema("success"), Function: doltPush},
@@ -51,7 +54,9 @@ var DoltProcedures = []sql.ExternalStoredProcedureDetails{
{Name: "dclone", Schema: int64Schema("status"), Function: doltClone},
{Name: "dcommit", Schema: stringSchema("hash"), Function: doltCommit},
{Name: "dfetch", Schema: int64Schema("success"), Function: doltFetch},
{Name: "dgc", Schema: int64Schema("status"), Function: doltGC},
// {Name: "dgc", Schema: int64Schema("status"), Function: doltGC},
{Name: "dmerge", Schema: int64Schema("fast_forward", "conflicts"), Function: doltMerge},
{Name: "dpull", Schema: int64Schema("fast_forward", "conflicts"), Function: doltPull},
{Name: "dpush", Schema: int64Schema("success"), Function: doltPush},

View File

@@ -1018,6 +1018,7 @@ func TestDoltReset(t *testing.T) {
}
func TestDoltGC(t *testing.T) {
t.SkipNow()
for _, script := range DoltGC {
enginetest.TestScript(t, newDoltHarness(t), script)
}

View File

@@ -1698,46 +1698,46 @@ var DoltConstraintViolationTransactionTests = []queries.TransactionTest{
},
},
},
{
Name: "Run GC concurrently with other transactions",
SetUpScript: gcSetup(),
Assertions: []queries.ScriptTestAssertion{
{
Query: "/* client a */ SELECT count(*) FROM t;",
Expected: []sql.Row{{250}},
},
{
Query: "/* client a */ START TRANSACTION",
Expected: []sql.Row{},
},
{
Query: "/* client b */ START TRANSACTION",
Expected: []sql.Row{},
},
{
Query: "/* client a */ CALL DOLT_GC();",
Expected: []sql.Row{{1}},
},
{
Query: "/* client b */ INSERT into t VALUES (300);",
Expected: []sql.Row{{types.NewOkResult(1)}},
},
{
Query: "/* client a */ COMMIT;",
Expected: []sql.Row{},
},
{
Query: "/* client b */ COMMIT;",
Expected: []sql.Row{},
},
{
Query: "/* client a */ SELECT count(*) FROM t;",
Expected: []sql.Row{{251}},
},
{
Query: "/* client b */ SELECT count(*) FROM t;",
Expected: []sql.Row{{251}},
},
},
},
// {
// Name: "Run GC concurrently with other transactions",
// SetUpScript: gcSetup(),
// Assertions: []queries.ScriptTestAssertion{
// {
// Query: "/* client a */ SELECT count(*) FROM t;",
// Expected: []sql.Row{{250}},
// },
// {
// Query: "/* client a */ START TRANSACTION",
// Expected: []sql.Row{},
// },
// {
// Query: "/* client b */ START TRANSACTION",
// Expected: []sql.Row{},
// },
// {
// Query: "/* client a */ CALL DOLT_GC();",
// Expected: []sql.Row{{1}},
// },
// {
// Query: "/* client b */ INSERT into t VALUES (300);",
// Expected: []sql.Row{{types.NewOkResult(1)}},
// },
// {
// Query: "/* client a */ COMMIT;",
// Expected: []sql.Row{},
// },
// {
// Query: "/* client b */ COMMIT;",
// Expected: []sql.Row{},
// },
// {
// Query: "/* client a */ SELECT count(*) FROM t;",
// Expected: []sql.Row{{251}},
// },
// {
// Query: "/* client b */ SELECT count(*) FROM t;",
// Expected: []sql.Row{{251}},
// },
// },
// },
}

View File

@@ -321,6 +321,8 @@ skip_if_chunk_journal() {
}
@test "garbage_collection: online gc" {
skip "dolt_gc is currently disabled"
dolt sql <<SQL
CREATE TABLE test (pk int PRIMARY KEY);
INSERT INTO test VALUES (1),(2),(3),(4),(5);
@@ -347,6 +349,8 @@ SQL
}
@test "garbage_collection: online shallow gc" {
skip "dolt_gc is currently disabled"
skip_if_chunk_journal
create_many_commits
@@ -367,4 +371,4 @@ SQL
echo "$BEFORE"
echo "$AFTER"
[ "$BEFORE" -gt "$AFTER" ]
}
}