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

[MySQL Conformance] fix tree size bug #382

Merged

Conversation

mhutchinson
Copy link
Contributor

@mhutchinson mhutchinson commented Dec 5, 2024

Major changes:

  • MySQL storage read methods return os.ErrNotExist when values aren't found
  • ReadTile returns an error if the user requests more data than we have available
  • Added tests for writing and reading data from tiles
  • Made tests hermetic (though slower) by resetting the DB for each test case

This got a bit bigger than intended.

This fixes #364.

@roger2hk
Copy link
Contributor

roger2hk commented Dec 5, 2024

There is also a bug in the mysql_test/TestTileRoundTrip. The nodeIndex should be replaced with nodeIndex+1 when passing into the s.ReadTile.

tileLevel, tileIndex, _, nodeIndex := layout.NodeCoordsToTileAddress(0, entryIndex)
tileRaw, err := s.ReadTile(ctx, tileLevel, tileIndex, nodeIndex)

@mhutchinson mhutchinson force-pushed the b364-fixmySqlConformance branch 2 times, most recently from 73d6d85 to 5f73ad1 Compare December 5, 2024 12:33
storage/mysql/mysql.go Outdated Show resolved Hide resolved
@mhutchinson mhutchinson force-pushed the b364-fixmySqlConformance branch 2 times, most recently from 294e991 to 4f05e57 Compare December 5, 2024 12:51
@mhutchinson mhutchinson marked this pull request as ready for review December 5, 2024 12:51
@mhutchinson mhutchinson force-pushed the b364-fixmySqlConformance branch from 4f05e57 to 6103bee Compare December 5, 2024 12:56
@mhutchinson
Copy link
Contributor Author

@roger2hk @AlCutter PTAL - this is passing the tests now.

storage/mysql/mysql.go Outdated Show resolved Hide resolved
storage/mysql/mysql.go Outdated Show resolved Hide resolved
storage/mysql/mysql.go Outdated Show resolved Hide resolved
storage/mysql/mysql.go Show resolved Hide resolved
storage/mysql/mysql_test.go Outdated Show resolved Hide resolved
Copy link
Contributor Author

@mhutchinson mhutchinson left a comment

Choose a reason for hiding this comment

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

Done!

storage/mysql/mysql.go Outdated Show resolved Hide resolved
storage/mysql/mysql.go Outdated Show resolved Hide resolved
storage/mysql/mysql_test.go Outdated Show resolved Hide resolved
storage/mysql/mysql.go Show resolved Hide resolved
Major changes:
 - MySQL storage read methods return os.ErrNotExist when values aren't found
 - ReadTile returns an error if the user requests more data than we have
   available
 - Added tests for writing and reading data from tiles
 - Made tests hermetic (though slower) by resetting the DB for each test
   case

This got a bit bigger than intended.
@mhutchinson mhutchinson force-pushed the b364-fixmySqlConformance branch from 693ba17 to a09c4b8 Compare December 5, 2024 14:19
@mhutchinson mhutchinson merged commit c57fd57 into transparency-dev:main Dec 5, 2024
15 checks passed
@mhutchinson mhutchinson deleted the b364-fixmySqlConformance branch December 5, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MySQL full tiles are not immutable
3 participants