Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a local audit persistence feature, allowing audit information to be saved directly to the local cluster's audit database and bypassing the external taoskeeper module. Key changes include updating the audit library to manage internal database connections, modifying the client monitor to skip auditing for internal requests, and refactoring the test suite to validate local sink functionality. Review feedback identifies a resource leak in the audit cleanup routine due to a missing taos_cleanup() call and recommends removing auxiliary files like command.txt and requirement.txt that do not belong in the source repository.
| (void)taosThreadMutexUnlock(&tsAudit.connLock); | ||
| (void)taosThreadMutexDestroy(&tsAudit.connLock); | ||
| (void)taosThreadMutexDestroy(&tsAudit.recordLock); | ||
| (void)taosThreadRwlockDestroy(&tsAudit.infoLock); |
There was a problem hiding this comment.
The auditInit function calls taos_init(), which allocates resources that must be freed. The corresponding taos_cleanup() call is missing in auditCleanup, which will lead to a memory leak. Please add taos_cleanup() at the end of this function.
(void)taosThreadRwlockDestroy(&tsAudit.infoLock);
taos_cleanup();| @@ -0,0 +1 @@ | |||
| pytest cases/80-Components/01-Taosd/test_com_taosd_audit.py -q -s --log-level=DEBUG --clean No newline at end of file | |||
| @@ -0,0 +1 @@ | |||
| 实现一个审计功能。目前的审计功能是将审计信息通过http发送给另外一个叫taoskeeper的独立模块(一个独立进程),再由taoskeeper再写到audit库中。现在要实现的审计功能是绕过taoskeeper,也就是不通过发送http消息,而是直接将审计信息保存到本地集群的audit库中。实现一下这个功能。一个可能的思路是,将发给taoskeeper的消息,通过节点间的rpc消息,发送给vnode,vnode收到这个消息后,模拟vnode从客户端收到的写入数据的消息,保存到审计库中。请详细深入的分析一下已有代码,并实现这个功能。 | |||
There was a problem hiding this comment.
This file contains a feature description in Chinese, which seems to be a prompt for a code generation tool. Such files should not be included in the project's source control. Please remove it. Also, the filename requirement.txt is conventionally used for Python dependencies, which is misleading here.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.