From: Vladimir Davydov <vdavydov.dev@gmail.com> To: Konstantin Osipov <kostja@tarantool.org>, Serge Petrenko <sergepetrenko@tarantool.org> Cc: tarantool-patches@freelists.org, Kirill Yukhin <kyukhin@tarantool.org> Subject: Re: [tarantool-patches] Re: [PATCH v2] xrow: print corrupted rows on decoding error. Date: Fri, 5 Apr 2019 16:43:20 +0300 [thread overview] Message-ID: <20190405134320.2j6utjziiwtmowxq@esperanza> (raw) In-Reply-To: <20190405132015.GA1687@chai> On Fri, Apr 05, 2019 at 04:20:15PM +0300, Konstantin Osipov wrote: > * Vladimir Davydov <vdavydov.dev@gmail.com> [19/04/05 16:11]: > > > But provided you had to write your own implementation: > > > - why use a macro? > > > > So that diag_set() and say() preserve file/line. > > You inline the macro multiple times. This makes the function body > longer -> CPU job more difficult. You could easily pass file and > line into the function, these are ansi c standard macros, __FILE__ > and __LINE__ You're right. Let's move print to a helper function then. > > > > > - why use malloc? > > > > Because a corrupted request can easily be longer than 256 bytes (that's > > how many bytes fits in tt_static_buf). Since it's a slow path, which is > > only executed on decode error provided S_VERBOSE log level is enabled, > > I reckon using malloc() is fine. > > It's 1024 bytes. > What's the point of printing it as a single say() call, not as > multiple ones? > > Besides, there is a 4k buffer inside say which limits you anwyay. Makes sense. Sergey, please prepare a follow-up patch to fix these issues.
prev parent reply other threads:[~2019-04-05 13:43 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-01 13:09 Serge Petrenko 2019-04-03 9:18 ` Vladimir Davydov 2019-04-03 9:41 ` [tarantool-patches] " Kirill Yukhin 2019-04-04 11:52 ` Serge Petrenko 2019-04-04 12:06 ` Vladimir Davydov 2019-04-04 12:29 ` Serge Petrenko 2019-04-04 14:51 ` Vladimir Davydov 2019-04-05 6:18 ` Konstantin Osipov 2019-04-05 8:06 ` Vladimir Davydov 2019-04-05 13:20 ` Konstantin Osipov 2019-04-05 13:43 ` Vladimir Davydov [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190405134320.2j6utjziiwtmowxq@esperanza \ --to=vdavydov.dev@gmail.com \ --cc=kostja@tarantool.org \ --cc=kyukhin@tarantool.org \ --cc=sergepetrenko@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] Re: [PATCH v2] xrow: print corrupted rows on decoding error.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox