Skip to content
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

Add new flag "return nothing" in options for DML operations #267

Closed
wey1and opened this issue Mar 17, 2022 · 2 comments · Fixed by #356
Closed

Add new flag "return nothing" in options for DML operations #267

wey1and opened this issue Mar 17, 2022 · 2 comments · Fixed by #356
Assignees
Labels
feature A new functionality teamE

Comments

@wey1and
Copy link

wey1and commented Mar 17, 2022

It is necessary to add the "return nothing" flag to the options of such functions as: truncate(), replace(), etc. Where the return of a function is not so important, but performance may be required.

The same was in TDG2 https://github.com/tarantool/tdg2/issues/1450

@Totktonada Totktonada added feature A new functionality teamE labels Mar 17, 2022
@Totktonada
Copy link
Member

It is especially important for crud.*_many() operations (see PR #232). I propose noreturn name.

@LeonidVas LeonidVas added the 2sp label Dec 7, 2022
GRISHNOV added a commit that referenced this issue Mar 27, 2023
This patch introduces `noreturn` opt for some DML operarions (`insert`,
`replace`, `update`, `delete`, `insert_many`, `replace_many`) which
suppress returning successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 28, 2023
This patch introduces `noreturn` opt for some DML operarions (`insert`,
`replace`, `update`, `delete`, `insert_many`, `replace_many`) which
suppress returning successfully processed tuple(s).

Closes #267
@DifferentialOrange
Copy link
Member

DifferentialOrange commented Mar 29, 2023

There is a question about what exactly "no value" value is. let's discuss existing API first.

Core Tarantool space:upsert does not return any values with nil response. crud.upsert success response is { rows = {}, metadata = ... }, while crud.upsert_many is { metadata = ... } (res.rows == nil) (see also #357). TDG2 skip_result returns empty array instead of array with data.

So we have the following response alternatives for (at least partially) successful noreturn operation:

  • { rows = {}, metadata = ... }
  • { metadata = ... }
  • {}
  • true
  • nil

(Bear in mind that in the case of the last three alternatives, we'll need to support noreturn for upsert operations too.)

The main motivation of noreturn is to reduce the overhead on useless tuple transfer between router and storage. It seems that the solution on this side would be roughly the same for all of the alternatives. But there is the other point: to reduce the overhead on useless info transfer between the router and the connector (like go-tarantool, tarantool-python, cartridge-java). In this case, the latter -- nil -- seems better.

On the other hand, receiving nil, nil in case of success may be a little confusing. But since noreturn is an optional one and the user of noreturn will know exactly what they expect, it seems fine.

(It is also worth to mention that in case of *_many operations we may have partial success with resp, errs that will transfer to nil, errs. But since the user of noreturn does not interested in what exactly has been succeed, it should be fine.)

GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for some DML operarions
(`insert`, `replace`, `update`, `delete`, `insert_many`,
`replace_many`, `upsert_many`) which suppress returning
successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for some DML operarions
(`insert`, `replace`, `update`, `delete`, `insert_many`,
`replace_many`, `upsert_many`) which suppress returning
successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for some DML operarions
(`insert`, `replace`, `update`, `delete`, `insert_many`,
`replace_many`, `upsert_many`) which suppress returning
successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for some DML operarions
(`insert`, `replace`, `update`, `delete`, `insert_many`,
`replace_many`, `upsert_many`) which suppress returning
successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for some DML operarions
(`insert`, `insert_object`, `replace`, `replace_object`, `update`,
`delete`, `insert_many`, `replace_many`, `upsert_many`) which
suppress returning successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 29, 2023
This patch introduces `noreturn` opt for DML operarions:
`insert`, `insert_object`, `insert_many`, `insert_object_many`,
`replace`, `replace_object`, `replace_many`, `insert_object_many`,
`upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
`update`, `delete`.
The opt allows to suppress returning successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 31, 2023
This patch introduces `noreturn` opt for DML operarions:
`insert`, `insert_object`, `insert_many`, `insert_object_many`,
`replace`, `replace_object`, `replace_many`, `insert_object_many`,
`upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
`update`, `delete`.
The opt allows to suppress returning successfully processed tuple(s).

Closes #267
GRISHNOV added a commit that referenced this issue Mar 31, 2023
This patch introduces `noreturn` opt for DML operarions:
`insert`, `insert_object`, `insert_many`, `insert_object_many`,
`replace`, `replace_object`, `replace_many`, `insert_object_many`,
`upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
`update`, `delete`.
The opt allows to suppress returning successfully processed tuple(s).

Closes #267
DifferentialOrange pushed a commit that referenced this issue Apr 3, 2023
This patch introduces `noreturn` opt for DML operarions:
`insert`, `insert_object`, `insert_many`, `insert_object_many`,
`replace`, `replace_object`, `replace_many`, `insert_object_many`,
`upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
`update`, `delete`.
The opt allows to suppress returning successfully processed tuple(s).

Closes #267
DifferentialOrange added a commit that referenced this issue Jun 6, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 6, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
DifferentialOrange added a commit that referenced this issue Jun 7, 2023
Overview

  This release add two new flags: `noreturn` to ignore return values
  excessive transfer and encoding/decoding for insert/replace/etc
  (performance improvement up to 10% for batch requests) and
  `fetch_latest_metadata` to force fetching latest space format metadata
  right after a live migration (performance overhead may be up to 15%).

New features
  * Add `noreturn` option for operations:
    `insert`, `insert_object`, `insert_many`, `insert_object_many`,
    `replace`, `replace_object`, `replace_many`, `insert_object_many`,
    `upsert`, `upsert_object`, `upsert_many`, `upsert_object_many`,
    `update`, `delete` (#267).

Bugfixes
  * Crud DML operations returning stale schema for metadata generation.
    Now you may use `fetch_latest_metadata` flag to work with latest
    schema (#236).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality teamE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants