-
Notifications
You must be signed in to change notification settings - Fork 5k
Enh/add stream latency marks #33527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enh/add stream latency marks #33527
Conversation
…gine into enh/addStreamLatency-marks
Summary of ChangesHello @wangmm0220, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant improvements to the system's caching mechanisms, particularly for stable tag filters and statistical information. The changes aim to provide better insights into cache performance through new metrics, enhance memory safety by refining LRU cache handle management and pointer ownership, and improve debugging capabilities with more verbose logging. These updates contribute to a more robust and observable caching infrastructure. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces several valuable improvements, primarily focused on enhancing stream latency monitoring and fixing caching-related bugs. Key changes include adding more detailed logging and metrics for cache performance, which will significantly improve observability. A critical bug fix addresses a potential use-after-free issue by refining the management of LRU cache handles. Additionally, the code now correctly uses the stable tag filter cache's access times for metrics, fixing a notable bug. The ownership semantics for certain data structures have been clarified by using pointer-to-pointers, which helps prevent memory leaks. Overall, these are solid improvements to the stability and maintainability of the codebase. I've identified a memory leak and a couple of areas where error handling could be made more robust.
| taosArrayDestroy(pUidList); | ||
| taosArrayDestroy(pTagColIds); | ||
| taosMemFreeClear(pTagCondKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| metaInfo("vgId:%d, suid:%" PRIu64 " new tag data filter entry added" | ||
| "(stable num:%d, total tag data entries num:%" PRIu32 "); " | ||
| "this tag condition data entries num:%d, " | ||
| "current stable tag conditions num:%d, " | ||
| "total tag data entries num:%" PRIu32, | ||
| vgId, suid, (int32_t)taosHashGetSize(pTableEntry), | ||
| pTagConds ? (int32_t)taosHashGetSize((*pTagConds)->set) : 0); | ||
| pMeta->pCache->sStableTagFilterResCache.numTagDataEntries, | ||
| pTagConds ? (int32_t)taosHashGetSize((*pTagConds)->set) : 0, | ||
| pFilterEntry ? (int32_t)taosHashGetSize((*pFilterEntry)->set) : 0, | ||
| (*pTagConds)->numTagDataEntries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message has "total tag data entries num" twice, referring to two different metrics (total in cache vs. total in the current stable table). This is confusing. The second instance should be renamed for clarity to distinguish between the total for the entire cache and the total for the current stable table.
metaInfo("vgId:%d, suid:%" PRIu64 " new tag data filter entry added"
"(stable num:%d, total tag data entries num:%" PRIu32 "); "
"this tag condition data entries num:%d, "
"current stable tag conditions num:%d, "
"current stable total tag data entries num:%" PRIu32,
vgId, suid, (int32_t)taosHashGetSize(pTableEntry),
pMeta->pCache->sStableTagFilterResCache.numTagDataEntries,
pTagConds ? (int32_t)taosHashGetSize((*pTagConds)->set) : 0,
pFilterEntry ? (int32_t)taosHashGetSize((*pFilterEntry)->set) : 0,
(*pTagConds)->numTagDataEntries);| if (p1 == NULL) { | ||
| return terrno; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (p2 == NULL) { | ||
| return terrno; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Please briefly describe the code changes in this pull request.
Checklist
Please check the items in the checklist if applicable.