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

batch send err:compress: buf size 607047244 > 134217728 max size #721

Closed
hanjm opened this issue Aug 13, 2022 · 6 comments · Fixed by ClickHouse/ch-go#173
Closed

batch send err:compress: buf size 607047244 > 134217728 max size #721

hanjm opened this issue Aug 13, 2022 · 6 comments · Fixed by ClickHouse/ch-go#173
Assignees

Comments

@hanjm
Copy link
Contributor

hanjm commented Aug 13, 2022

Issue description

Hi, i am using natvie batch with compress, i found if batch size greater 128MB, will produce a error message when invoke batch.send().
it seems has a hard limit for size of compress data, what should i do.
https://github.com/ClickHouse/ch-go/blob/main/compress/writer.go#L22
https://github.com/ClickHouse/ch-go/blob/main/compress/compress.go#L31

Example code

	batch, err := db.PrepareBatch(ctx, insertSQL)
	if err != nil {
		return fmt.Errorf("prepare batch err:%w", err)
	}
        // vs is 200k length array, total size execeed 128MB 
        for v:=range vs {
            err:=batch.Append(v)
             if err != nil {
			return fmt.Errorf("batch append err:%w", err)
		}
       }
      	if err = batch.Send(); err != nil {
		return fmt.Errorf("batch send err:%w", err)
	}

Error log

batch send err:compress: buf size 607047244 > 134217728 max size

Configuration

OS:
Linux
Interface: E.g. native, database/sql
native
Driver version:
2.23-bata2
Go version: run go version in your console
1.18.2
ClickHouse Server version:
21.8.12

@gingerwizard
Copy link
Collaborator

This is a ch-go limitation @ernado can we make this configurable?

@ernado
Copy link
Collaborator

ernado commented Aug 15, 2022

Yes, we can do it. It was introduced to prevent user from accidental OOM.

@gingerwizard
Copy link
Collaborator

If you expose in ch-go (maybe an env variable or settings passed to the encoder init?) we can document in clickhouse-go.

@ernado
Copy link
Collaborator

ernado commented Aug 15, 2022

Lol, now we can close issues with cross-repo references? 🤔

It should be fixed in ch-go@v0.47.3, I've removed this check entirely, we don't need it on data block write.

@gingerwizard
Copy link
Collaborator

@hanjm next release. Probably Friday or latest next monday.

@hanjm
Copy link
Contributor Author

hanjm commented Aug 16, 2022

so quickly. thank you. :)

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 a pull request may close this issue.

3 participants