-
Notifications
You must be signed in to change notification settings - Fork 212
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
Potential data loss with lua triggers #3361
Comments
You're right looks like there's no way to bypass the auto-consume logic in |
cdb2_close() attempts to drain unfetched rows in order to make the connection reusable for the next sockpool user. This logic however may undesirably consume events from a consumer. Disable it by default. Fixes bloomberg#3361. Signed-off-by: Rivers Zhang <hzhang320@bloomberg.net>
@gusmonod Context about the auto-consume logic: This is to paper over a common misuse of the Comdb2 API when calling |
Our python wrapper (python-comdb2) will make sure to consume everything to |
No need - I was just pointing out the misuse is widespread (and easy to do) which is why the kludge was added. |
cdb2_close() attempts to drain unfetched rows in order to make the connection reusable for the next sockpool user. This logic however may undesirably consume events from a consumer. Disable it by default. Fixes #3361. Signed-off-by: Rivers Zhang <hzhang320@bloomberg.net>
Describe the bug
When closing the connection in the middle of consuming items from a lua trigger, we would expect for the item to be acknowledged, and a subsequent re-opening of the connection to be able to resume to the next item in the queue, but instead it seems that the next items on the queue are not re-delivered.
To Reproduce
Steps to reproduce the behavior:
echo "$COMDB2_DBNAME 1234 $(hostname -f)" > /opt/bb/etc/cdb2/config/comdb2db.cfg
)monitored
table (e.g./opt/bb/bin/cdb2sql mattdb dev "insert into monitored(id, message) values (5, 'five')"
)Expected behavior
We should be able to consume the event showing
3, NULL, bye
and not hang.Screenshots
Environment (please complete the following information):
Additional context
To see how we are creating the environment, compiling comdb2, creating and starting the local instance see: https://github.com/bloomberg/python-comdb2/blob/bf9f758ef7eb291fe5c0072fa0fb0e39bc5e421c/.github/workflows/build.yml
The text was updated successfully, but these errors were encountered: