Skip to content

Buffer WAL writes#1018

Merged
joe-elliott merged 17 commits intografana:mainfrom
joe-elliott:buffer-file-writes
Oct 9, 2021
Merged

Buffer WAL writes#1018
joe-elliott merged 17 commits intografana:mainfrom
joe-elliott:buffer-file-writes

Conversation

@joe-elliott
Copy link
Copy Markdown
Collaborator

@joe-elliott joe-elliott commented Oct 7, 2021

What this PR does:
Buffers wal writes using a bufio.Writer. Adds a configurable buffer size that defaults to 1MB.

Early testing looks good, but I'm still gathering evidence that it is a positive change. Marked draft for now.

Draft dropped. Avg working set of ingesters much lower since the change:

image

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott marked this pull request as ready for review October 8, 2021 15:38
Signed-off-by: Joe Elliott <number101010@gmail.com>
Comment thread tempodb/wal/wal.go
// blockID, tenantID, version, encoding (compression), dataEncoding
filename := fmt.Sprintf("%v:%v:%v:%v:%v", blockid, tenantid, "v2", backend.EncNone, "")
return os.OpenFile(filepath.Join(p, filename), os.O_CREATE|os.O_RDWR, 0644)
file, err := os.OpenFile(filepath.Join(p, filename), os.O_CREATE|os.O_RDWR, 0644)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0640 perhaps?

Copy link
Copy Markdown
Contributor

@KMiller-Grafana KMiller-Grafana left a comment

Choose a reason for hiding this comment

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

Docs portion of this PR looks good to me.

Copy link
Copy Markdown
Contributor

@mdisibio mdisibio left a comment

Choose a reason for hiding this comment

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

LGTM. Method renames are great. Left a few small questions, not-blocking.

Comment thread tempodb/wal/append_block.go
Comment thread modules/ingester/instance.go
Comment thread tempodb/search/streaming_search_block.go
Comment thread tempodb/wal/append_block.go
@joe-elliott joe-elliott merged commit 2ff99b6 into grafana:main Oct 9, 2021
joe-elliott added a commit to joe-elliott/tempo that referenced this pull request Oct 19, 2021
joe-elliott added a commit that referenced this pull request Oct 19, 2021
* Revert "Buffer WAL writes (#1018)"

This reverts commit 2ff99b6.

* Write->Append

Signed-off-by: Joe Elliott <number101010@gmail.com>

* restored manifest changes

Signed-off-by: Joe Elliott <number101010@gmail.com>

* put search_encoding back

Signed-off-by: Joe Elliott <number101010@gmail.com>

* GetIterator -> Iterator

Signed-off-by: Joe Elliott <number101010@gmail.com>

* lint

Signed-off-by: Joe Elliott <number101010@gmail.com>

* assert => require

Signed-off-by: Joe Elliott <number101010@gmail.com>
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.

4 participants