Skip to content

Conversation

Copy link

Copilot AI commented Jan 28, 2026

This PR addresses code review feedback on the self-audit feature implementation.

Changes

  • Error handling in vnode audit path: Added proper error checking and response code setting in TDMT_VND_AUDIT_RECORD handler to prevent silent failures

  • Audit config change detection: Fixed condition in mndDnode.c to include auditDBChanged flag, ensuring dnode receives updated audit DB configuration when only the DB name changes

  • Buffer overflow fix: Removed redundant dataLen field from SVAuditRecordReq and switched to tDecodeCStrAlloc to eliminate length-mismatch vulnerability in deserialization

  • SEpSet.inUse handling: Explicitly chose not to serialize inUse field as it represents transient leader state that is not stable across encode/decode boundaries. Added comments documenting this design decision.

// Before: Silent failure
case TDMT_VND_AUDIT_RECORD:
  code = vnodeProcessAuditRecordReq(pVnode, ver, pReq, len);
  break;

// After: Proper error propagation
case TDMT_VND_AUDIT_RECORD:
  code = vnodeProcessAuditRecordReq(pVnode, ver, pReq, len, pMsg);
  if (code) {
    pRsp->code = code;
    goto _err;
  }
  break;

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Jan 28, 2026
3 tasks
Copilot AI changed the title [WIP] Fix issue with self audit functionality Address code review feedback: fix error handling, audit config propagation, and buffer overflow Jan 28, 2026
@cadem cadem marked this pull request as ready for review January 28, 2026 07:12
Copilot AI requested a review from cadem January 28, 2026 07:13
@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@cadem cadem merged commit 9e2d61d into dmchen/self-audit-git Jan 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants