-
Notifications
You must be signed in to change notification settings - Fork 5k
fix(stream): fix tsma delay time report #34448
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
base: 3.3.8
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @JinqingKuang, 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 addresses an issue with the reporting of delay times within the TSMA (Time-Series Moving Average) stream processing. The core changes involve standardizing the unit of time for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 fixes a delay time reporting issue for TSMA by introducing a verTime field and propagating it through the stream processing pipeline. When there's no data, the current time is used as verTime to calculate the delay. The delay calculation logic is also updated to use microseconds. The changes appear correct and address the issue described in the title. My feedback focuses on improving code readability in a few places where complex pointer arithmetic is used, suggesting a more conventional array-style access.
| *(int64_t*)buf = resultRsp.ver; | ||
| *(((int64_t*)buf) + 1) = resultRsp.verTime; |
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.
| *(int64_t*)buf = resultRsp.ver; | ||
| *(((int64_t*)buf) + 1) = resultRsp.verTime; |
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.
| blockDataEmpty(pContext->pDropBlock); | ||
| pContext->pMetaBlock->info.version = *(int64_t *)pRsp->pCont; | ||
| if (pRsp->contLen > sizeof(int64_t)) { | ||
| pProgress->verTime = *(((int64_t *)pRsp->pCont) + 1); |
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.
| blockDataEmpty(pContext->pDropBlock); | ||
| pContext->pMetaBlock->info.version = *(int64_t *)pRsp->pCont; | ||
| if (pRsp->contLen > sizeof(int64_t)) { | ||
| pProgress->verTime = *(((int64_t *)pRsp->pCont) + 1); |
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.
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.
Pull request overview
This pull request fixes TSMA (Time-Series Moving Average) delay time reporting by correcting timestamp unit handling and ensuring consistent verTime tracking across the streaming system.
Changes:
- Fixed timestamp unit conversion in delay calculation from nanoseconds to microseconds
- Enhanced protocol to optionally include verTime in no-data responses
- Added verTime initialization in WAL scanning paths
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/ci/cases.task | Removed timeout configuration for test_tsma.py test (likely no longer needed after timing fix) |
| source/libs/new-stream/src/streamTriggerTask.c | Fixed delay calculation to use microseconds and made protocol backward compatible for optional verTime extraction |
| source/dnode/vnode/src/vnd/vnodeStream.c | Added verTime initialization in WAL scan paths and updated no-data responses to include verTime |
| include/common/streamMsg.h | Added documentation clarifying verTime is in microseconds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
fix(stream): fix tsma delay time report
Issue(s)
Checklist
Please check the items in the checklist if applicable.