Skip to content

Fix iproto index name to ID mapping#10902

Merged
sergepetrenko merged 1 commit intotarantool:masterfrom
rorororom:9923_fix_iproto_name_mapping
Dec 24, 2024
Merged

Fix iproto index name to ID mapping#10902
sergepetrenko merged 1 commit intotarantool:masterfrom
rorororom:9923_fix_iproto_name_mapping

Conversation

@rorororom
Copy link
Contributor

@rorororom rorororom commented Dec 6, 2024

iproto: fix IPROTO index name to ID mapping

Previously, index names were resolved to dense IDs, which caused
failures when accessing indexes by name. This happened because the
index_map lookup expected user-visible IDs (index->def->iid), not dense IDs.

The fix replaces dense_id with index->def->iid to ensure correct mapping
of index names to their numeric IDs, aligning with the expected behavior
when accessing indexes by name.

Closes #9923

@rorororom rorororom requested a review from drewdzzz December 6, 2024 10:56
@rorororom rorororom requested a review from a team as a code owner December 6, 2024 10:56
@coveralls
Copy link

coveralls commented Dec 6, 2024

Coverage Status

coverage: 87.369% (-0.02%) from 87.387%
when pulling 524976b on rorororom:9923_fix_iproto_name_mapping
into 0f373b3
on tarantool:master
.

Copy link
Contributor

@drewdzzz drewdzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! See my comments below.

Regarding commit message:

Header:

  1. Do not use capital letter after the category name (Correct -> correct)
  2. Let's replace word "correct" with "fix" - "correct" is often used as an adjective and "fix" is always a verb.

Body:

  1. Please, do not use multiple spaces between sentences.
  2. I would rephrase it in such way: explain the problem (that Tarantool resolved name to dense id but Tarantool requests actually expect id observed by user - index->def->iid) and after that something like "The commit fixed this problem". What's about the current message - it's still not clear why you replaced dense_id with index->def->iid.
  3. "fail due to incorrect index ID resolution when fetch_schema was false" - did you check it? Does it really works with fetch_schema = true?

@drewdzzz drewdzzz assigned rorororom and unassigned drewdzzz Dec 6, 2024
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch 3 times, most recently from 92520c0 to 2eee83a Compare December 8, 2024 19:19
@rorororom rorororom assigned drewdzzz and unassigned rorororom Dec 9, 2024
Copy link
Contributor

@drewdzzz drewdzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes!
I have no objections regarding the fix, commit message and changelog. Let's just slightly improve the test.

@drewdzzz drewdzzz assigned rorororom and unassigned drewdzzz Dec 9, 2024
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch from 2eee83a to 6859c1f Compare December 9, 2024 08:43
@rorororom rorororom assigned drewdzzz and unassigned rorororom Dec 9, 2024
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch 2 times, most recently from 31a9d1f to ac51730 Compare December 9, 2024 09:30
Copy link
Contributor

@drewdzzz drewdzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes! Looks good, just a few nitpicks.

@drewdzzz drewdzzz assigned rorororom and unassigned drewdzzz Dec 9, 2024
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch from ac51730 to a40756f Compare December 13, 2024 10:58
@rorororom rorororom assigned drewdzzz and unassigned rorororom Dec 13, 2024
@rorororom rorororom requested a review from drewdzzz December 13, 2024 11:31
Copy link
Contributor

@drewdzzz drewdzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch, LGTM!

Copy link
Member

@CuriousGeorgiy CuriousGeorgiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Maria, nice to meet you! Great first patch to start your Tarantool journey!

I have left some comments below regarding polishing of the test. These comments are mostly nitpicks, lifehacks, tricks and conventional Tarantool wisdom.

Please expect a lot of them in the beginning of your journey — they do not in any way diminish your hard skills, their goal is rather to calibrate you to our development traditions and expectations.

@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch 4 times, most recently from 33eda19 to 15d5e2d Compare December 16, 2024 21:29
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch from 15d5e2d to 770973b Compare December 20, 2024 07:56
Previously, index names were resolved to dense IDs, which caused
failures when accessing indexes by name. This happened because the
index_map lookup expected user-visible IDs (index->def->iid), not
dense IDs.

The fix replaces dense_id with index->def->iid to ensure correct
mapping of index names to their numeric IDs.

Closes tarantool#9923

NO_DOC=bug fix
@rorororom rorororom force-pushed the 9923_fix_iproto_name_mapping branch from 770973b to 524976b Compare December 20, 2024 09:20
@CuriousGeorgiy CuriousGeorgiy added the full-ci Enables all tests for a pull request label Dec 20, 2024
@sergepetrenko sergepetrenko merged commit ef3775a into tarantool:master Dec 24, 2024
@sergepetrenko
Copy link
Collaborator

Backports:
3.3 #10982
3.2 #10983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid IPROTO_INDEX_NAME mapping on the server side.

6 participants