Skip to content

Commit

Permalink
debugging BTree Index: activated comment-outed codes and changed conc…
Browse files Browse the repository at this point in the history
…urrent executinon type to SERIAL_EXEC but testcase failed.
  • Loading branch information
ryogrid committed Aug 31, 2024
1 parent 7f06446 commit af7df62
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func testBTreeParallelTxnStrideRoot[T int32 | float32 | string](t *testing.T, ke
//InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 3000, 13, 0, bpoolSize, index_constants.INDEX_KIND_SKIP_LIST, SERIAL_EXEC, 20)

//InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 3000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20)
InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 1000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 1)
InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 1000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1)

//InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 3000, 13, 0, bpoolSize, index_constants.INDEX_KIND_SKIP_LIST, PARALLEL_EXEC, 20)
case types.Float:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,14 +806,14 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t

common.ShPrintf(common.DEBUGGING, "Delete(fail) op start.\n")
delPlan := createSpecifiedValDeletePlanNode(delKeyVal, c, tableMetadata, keyType, indexKind)
//results := executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
results := executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
//executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)

if txn_.GetState() == access.ABORTED {
break
}

//common.SH_Assert(results != nil && len(results) == 0, "delete(fail) should be fail!")
common.SH_Assert(results != nil && len(results) == 0, "delete(fail) should be fail!")
}

finalizeRandomDeleteNotExistingTxn(txn_, delKeyValBase)
Expand Down Expand Up @@ -850,14 +850,14 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t
common.ShPrintf(common.DEBUGGING, "Delete(success) op start %v.\n", delKeyVal)

delPlan := createSpecifiedValDeletePlanNode(delKeyVal, c, tableMetadata, keyType, indexKind)
//results := executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
results := executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)
//executePlan(c, shi.GetBufferPoolManager(), txn_, delPlan)

if txn_.GetState() == access.ABORTED {
break
}

//common.SH_Assert(results != nil && len(results) == 2, "Delete(success) failed!")
common.SH_Assert(results != nil && len(results) == 2, "Delete(success) failed!")
}

finalizeRandomDeleteExistingTxn(txn_, delKeyValBase)
Expand Down Expand Up @@ -911,8 +911,8 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t
common.ShPrintf(common.DEBUGGING, "Update (random) op start.")

updatePlan1 := createAccountIdUpdatePlanNode(updateKeyVal, updateNewKeyVal, c, tableMetadata, keyType, indexKind)
//results1 := executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan1)
executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan1)
results1 := executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan1)
//executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan1)

if txn_.GetState() == access.ABORTED {
break
Expand All @@ -921,18 +921,18 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t
//if results1 == nil || len(results1) != 2 {
// fmt.Println("results1 is nil or len(results1) != 2")
//}
//common.SH_Assert(results1 != nil && len(results1) == 2, "Update failed!")
common.SH_Assert(results1 != nil && len(results1) == 2, "Update failed!")

updatePlan2 := createBalanceUpdatePlanNode(updateNewKeyVal, newBalanceVal, c, tableMetadata, keyType, indexKind)

//results2 := executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan2)
executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan2)
results2 := executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan2)
//executePlan(c, shi.GetBufferPoolManager(), txn_, updatePlan2)

if txn_.GetState() == access.ABORTED {
break
}

//common.SH_Assert(results2 != nil && len(results2) == 2, "Update failed!")
common.SH_Assert(results2 != nil && len(results2) == 2, "Update failed!")
}

finalizeRandomUpdateTxn(txn_, updateKeyValBase, updateNewKeyValBase)
Expand Down Expand Up @@ -967,14 +967,14 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t

common.ShPrintf(common.DEBUGGING, "Select(fail) op start.")
selectPlan := createSpecifiedPointScanPlanNode(getKeyVal, c, tableMetadata, keyType, indexKind)
//results := executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
results := executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
//executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)

if txn_.GetState() == access.ABORTED {
break
}

//common.SH_Assert(results != nil && len(results) == 0, "Select(fail) should be fail!")
common.SH_Assert(results != nil && len(results) == 0, "Select(fail) should be fail!")
}

finalizeSelectNotExistingTxn(txn_, getTgtBase)
Expand Down Expand Up @@ -1006,20 +1006,20 @@ func InnerTestParallelTxnsQueryingIndexUsedColumns[T int32 | float32 | string](t

common.ShPrintf(common.DEBUGGING, "Select(success) op start.")
selectPlan := createSpecifiedPointScanPlanNode(getKeyVal, c, tableMetadata, keyType, indexKind)
//results := executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
results := executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)
//executePlan(c, shi.GetBufferPoolManager(), txn_, selectPlan)

if txn_.GetState() == access.ABORTED {
break
}

//if results == nil || len(results) != 2 {
// fmt.Println("results is nil or len(results) != 2")
//}
//common.SH_Assert(results != nil && len(results) == 2, "Select(success) should not be fail!")
//collectVal := types.NewInteger(getInt32ValCorrespondToPassVal(getKeyVal))
//gotVal := results[0].GetValue(tableMetadata.Schema(), 1)
//common.SH_Assert(gotVal.CompareEquals(collectVal), "value should be "+fmt.Sprintf("%d not %d", collectVal.ToInteger(), gotVal.ToInteger()))
if results == nil || len(results) != 2 {
fmt.Println("results is nil or len(results) != 2")
}
common.SH_Assert(results != nil && len(results) == 2, "Select(success) should not be fail!")
collectVal := types.NewInteger(getInt32ValCorrespondToPassVal(getKeyVal))
gotVal := results[0].GetValue(tableMetadata.Schema(), 1)
common.SH_Assert(gotVal.CompareEquals(collectVal), "value should be "+fmt.Sprintf("%d not %d", collectVal.ToInteger(), gotVal.ToInteger()))
}

finalizeSelectExistingTxn(txn_, getKeyValBase)
Expand Down

0 comments on commit af7df62

Please sign in to comment.