gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Forward complete QE notice messages

Open dh-cloud opened this issue 4 years ago • 4 comments

The QE notice message might be truncated because MPPnoticeReceiver() limited message lenght about 800 bytes sent to the client. The client should not see an incomplete notice message.

This commit changes its behaviour, it allows QE messages of any length (include QE identifier) to send to the client.

Here are some reminders before you submit the pull request

  • [ ] Add tests for the change
  • [ ] Document changes
  • [ ] Communicate in the mailing list if needed
  • [ ] Pass make installcheck
  • [ ] Review a PR in return to support the community

dh-cloud avatar Feb 25 '21 08:02 dh-cloud

What is the problem you're facing, exactly?

d avatar Feb 26 '21 04:02 d

What is the problem you're facing, exactly?

We have some functions/extensions elog messages from QE to the client for debug/dump purposes, e.g.

if (client_min_messages == LOG && Gp_role != GP_ROLE_DISPATCH)
{
	ereport(NOTICE, (errmsg("..."));
}

The messages may be long enough, > 1000 bytes. But

strncpy(message, pfield->contents, 800);
message[800] = '\0';

It causes truncation, even occasional cut of multi-byte chars.

dh-cloud avatar Feb 26 '21 06:02 dh-cloud

@dh-cloud I am continue to review your PR. At first glance, it looks good.

Only one concern is why limit 800 bytes, looks it's existed a long time (can be found in gp4 code). Do you think adding a GUC: to control 800 or non-limit bytes here is a good idea? Thanks.

interma avatar Sep 09 '22 07:09 interma

@dh-cloud I am continue to review your PR. At first glance, it looks good.

Only one concern is why limit 800 bytes, looks it's existed a long time (can be found in gp4 code). Do you think adding a GUC: to control 800 or non-limit bytes here is a good idea? Thanks.

@dh-cloud just a kindle reminder, please take a look.

interma avatar Sep 20 '22 07:09 interma

@dh-cloud I am continue to review your PR. At first glance, it looks good. Only one concern is why limit 800 bytes, looks it's existed a long time (can be found in gp4 code). Do you think adding a GUC: to control 800 or non-limit bytes here is a good idea? Thanks.

@dh-cloud just a kindle reminder, please take a look.

Sorry, the office external network is gone recently, i did not see github for a long time. This pr has two aim: 1) show full log message. 2) prevent multi-byte chars truncation. Is a new GUC really necessary?

dh-cloud avatar Sep 26 '22 11:09 dh-cloud

Got it, thanks @dh-cloud Considering it's only for master branch, it's ok to remove the 800 bytes limitation (without introduce a trivial GUC). I will verfiy this PR in my test env and give response later.

interma avatar Sep 29 '22 03:09 interma

@dh-cloud I have verified your PR in my env, it works and looks good, thanks for your contributions. Considering this PR has been open for a long time, please rebase the latest master (then trigger the pr-pipeline test again). If all is ok, this PR will be merged soon.

Thanks!

interma avatar Oct 08 '22 10:10 interma

Merged, thanks for your contributions.

interma avatar Oct 10 '22 02:10 interma