8000 Tags · EmilyOmier/YDB · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tags: EmilyOmier/YDB

Tags

r2.02

Toggle r2.02's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
[r2.02] Prepare for YottaDB r2.02 release

* This commit updates various files in anticipation of the upcoming r2.02 release.
  See d87c914 for similar changes at the time of `r2.00` release.

V7.1-006

Toggle V7.1-006's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-006

ato_2024

Toggle ato_2024's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
[#1100] Speed up untimed READ for SOCKET device with no delimiters; R…

…emove unnecessary fcntl() calls

Background
----------
Below is pasted from https://gitlab.com/YottaDB/DB/YDB/-/issues/1100#description

* See https://gitlab.com/YottaDB/DB/YDBXider/-/merge_requests/50#note_2176150894 for more details.

* In short, Xider was used a timed READ on a SOCKET device while waiting for a message from the client. I
  noticed from `strace` logs that various system calls were invoked for every timed READ to start a
  timer and later cancel the timer. Therefore, wanted a way to read from a socket device without having
  to start a timer.

* So looked at https://docs.yottadb.com/ProgrammersGuide/ioproc.html#read-commands and realized that
  the terminating conditions for a read that will let me do an untimed read is if a `Delimiter is seen`.

* But in Xider, we open the SOCKET device with NO delimiter as we want all the input data to be returned
  by the READ whereas with a DELIMITER, the delimiter that was read is discarded by the READ.

* Therefore, it seemed like even if Xider received say 32 bytes corresponding to a full Redis message
  with a `\r\n` terminator, we would still be waiting for a timeout to finish the READ when actually
  there is no need to sleep any more.

* This means we need a way to terminate an untimed READ even if the socket device has no DELIMITER as
  long as `some` data was received.

* Doing so would ensure we avoid unnecessarily sleeping for more data if we got some data to return from
  the READ.

Changes
-------
* `sr_port/iosocket_readfl.c` is modified to set the `more_data` variable to `FALSE` in the
  case the socket device has no delimiter defined (i.e. `has_delimiter` is FALSE), and it is an
  untimed READ (i.e. `timed` variable is FALSE) and there has been some non-zero data that was read
  (i.e. `bytes_read` variable is non-zero).

  This is the main change that would speed up READs by avoiding time spent unnecessarily sleeping
  for a timeout to happen or for a delimiter to show up.

* Due to the way `more_data` is now initialized even when `terminator` variable is TRUE, it was no
  longer necessary to initialize it to TRUE before the `for` loop and so that was removed.

* And lastly, I noticed a few `fcntl()` calls (done using the `FCNTL2` or `FCNTL3` macros) were
  unnecessary as they were done unconditionally even though they needed to be done only if it was
  a `nonblocking` socket device. Therefore, added a check of whether `socketptr->nonblocking` is
  TRUE and only in that case is the `fcntl()` call done. A new `reset_nonblocking` variable helps
  with this implementation.

V7.1-005

Toggle V7.1-005's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-005

V7.1-004

Toggle V7.1-004's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-004

r2.00

Toggle r2.00's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
[r2.00] Prepare for YottaDB r2.00 release

* This commit updates various files in anticipation of the upcoming r2.00 release.
  See 5f6623f for similar changes at the time of `r1.38` release.

V7.1-003

Toggle V7.1-003's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-003

V7.1-002

Toggle V7.1-002's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-002

V7.1-001

Toggle V7.1-001's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-001

V7.1-000

Toggle V7.1-000's commit message

Verified

This commit was signed with the committer’s verified signature.
nars1 Narayanan Iyer
GT.M V7.1-000

0