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

dump buffer on invalid insert #3613

Merged
merged 4 commits into from
Dec 11, 2023

Conversation

ruslandoga
Copy link
Contributor

This PR adds a temporary measure to check what's going on with invalid arrays in inserts.

"#{System.unique_integer([:positive])}-#{Exception.message(e)}.dump"
)

File.write!(path, state.buffer)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll need to test it by sending invalid row binary to the buffer. One moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried

Plausible.Event.WriteBuffer.insert(%Plausible.ClickhouseEventV2{"meta.key": [], "meta.value": ["a"]})

and it resulted in this file

998-Code: 190. DB::Exception: Elements 'meta.key' and 'meta.value' of Nested data structure 'meta' (Array columns) have different array sizes. (SIZES_OF_ARRAYS_DONT_MATCH) (version 23.3.7.5 (official build))?.dump

with the contents (passed through hexdump)

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000030  00 00 00 00 01 01 61 01  00 00 00 01 00 00 00 00  |......a.........|
00000040

e ->
path =
Path.join(
System.tmp_dir!(),
Copy link
Member

Choose a reason for hiding this comment

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

let's use PERSISTENT_CACHE_DIR here with always the same file name so subsequent failures overwrite rather than pile up? One should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aerosol aerosol merged commit 7a4cafa into plausible:master Dec 11, 2023
2 of 5 checks passed
aerosol added a commit that referenced this pull request Dec 11, 2023
@ruslandoga ruslandoga deleted the meta-array-length-issue branch June 10, 2024 16:33
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.

None yet

2 participants