You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The debug logging code is now enabled for all operations when fault injection is triggered or for intercepted tables. This could generate excessive logs in production environments and impact performance, especially for high-throughput insert/delete operations.
The code uses fault.TriggerFault but there's no visible import for the fault package in the diff. This could cause compilation errors if the import is not present elsewhere in the file.
Add nil check for req.Batch.Vecs[idx] before accessing it to prevent potential panic. The vector at index idx might be nil or the index could be out of bounds.
_, _, injected := fault.TriggerFault(objectio.FJ_CommitInsert)
if h.IsInterceptTable(tb.Schema(false).(*catalog.Schema).Name) || injected {
schema := tb.Schema(false).(*catalog.Schema)
if schema.HasPK() {
pkDef := schema.GetSingleSortKey()
idx := pkDef.Idx
+ if idx >= len(req.Batch.Vecs) || req.Batch.Vecs[idx] == nil {+ return+ }
isCompositeKey := pkDef.IsCompositeColumn()
for i := 0; i < req.Batch.Vecs[0].Length(); i++ {
...
}
}
}
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a potential panic from out-of-bounds access on req.Batch.Vecs[idx] and provides a valid check, improving the code's robustness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22115
What this PR does / why we need it:
Open commit inject logging
PR Type
Bug fix
Description
Enable commit insert logging injection for debugging
Uncomment and activate existing debug logging code
Add fault injection point for commit insert operations
Restore debug logging for delete operations
Changes diagram
Changes walkthrough 📝
injects.go
Add commit insert fault injection constantpkg/objectio/injects.go
FJ_CommitInsertconstant for fault injectionhandle.go
Enable commit operation debug loggingpkg/vm/engine/tae/rpc/handle.go
disttae_engine_test.go
Add commit insert fault injection testpkg/vm/engine/test/disttae_engine_test.go