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

Expose current identification_mode #460

Closed
DifferentialOrange opened this issue Dec 22, 2023 · 0 comments
Closed

Expose current identification_mode #460

DifferentialOrange opened this issue Dec 22, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@DifferentialOrange
Copy link
Member

DifferentialOrange commented Dec 22, 2023

#426 had introduced two vshard.storage.info() modes: with names as map keys and with uuids as map keys. There are some cases when .info() is processed automatically (for example, in tarantool/crud). To support new info layout in these cases, we need to know current identification_mode. And now there is no public API to discover it.

Several workarounds are available.

  1. Do not use keys at all, iterate through map and compare instance/replicaset .uuid/.name fields to search.
  2. Try to guess current mode by substituting both instance/replicaset uuid and name.
  3. Use private vshard.storage.internal.current_cfg variable to extract current configuration.

The first one is both non-optimal and inconvenient, the second uses some questionable assumptions (for example, what we should do if we had found both?), the third one may easily break since it is non-public API.

@DifferentialOrange DifferentialOrange changed the title Expose current identification_mode to public API Expose current identification_mode Dec 22, 2023
DifferentialOrange added a commit to tarantool/crud that referenced this issue Dec 28, 2023
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Dec 28, 2023
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Dec 29, 2023
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Dec 29, 2023
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Part of #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Dec 29, 2023
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Jan 9, 2024
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Jan 9, 2024
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
DifferentialOrange added a commit to tarantool/crud that referenced this issue Jan 10, 2024
PR #404 has introduced vshard 0.1.25 + Tarantool 3.0 "name as key"
identification mode based on UUIDs extraction. If works fine if
vshard configuration (or Tarantool 3.0 configuration which builds
vshard one) provides UUIDs, but fails if it isn't. Since UUIDs are
optional and won't be provided in most cases, it makes crud fails
to work on most Tarantool 3.0 vshard clusters. This patch fixes
the issue.

Now the code uses name as key, if corresponding mode is enabled, and
uuid otherwise. Patch doesn't cover `select_old` since it runs only
on pre-3.0 Tarantool. Unfortunately, code relies on vshard internals
since now there is no other way [1].

This patch covers new mode support for readview code as well. It likely
was broken before this patch even if UUIDs were provided.

1. tarantool/vshard#460

Follows #404
Closes #407
@Serpentian Serpentian self-assigned this Mar 21, 2024
@Serpentian Serpentian added the bug Something isn't working label Mar 21, 2024
Gerold103 pushed a commit that referenced this issue Apr 10, 2024
This commit exposes identification_mode to vshard.router.info(). It's
impossible to parse info now without accessing internal `current_cfg`
field.

Part of #460

NO_DOC=<minor change>
Gerold103 pushed a commit that referenced this issue Apr 10, 2024
This commit exposes identification_mode to vshard.storage.info(). It's
impossible to parse info now without accessing internal `current_cfg`
field.

Closes #460

NO_DOC=<minor change>
Gerold103 pushed a commit that referenced this issue Apr 10, 2024
This commit exposes identification_mode to vshard.router.info(). It's
impossible to parse info now without accessing internal `current_cfg`
field.

Part of #460

NO_DOC=<minor change>
Gerold103 pushed a commit that referenced this issue Apr 10, 2024
This commit exposes identification_mode to vshard.storage.info(). It's
impossible to parse info now without accessing internal `current_cfg`
field.

Closes #460

NO_DOC=<minor change>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants