Skip to content

SAMZA-2174: Throw a record too large exception for oversized records in changelog - #1008

Merged
cameronlee314 merged 12 commits into
apache:masterfrom
PawasChhokra:changelog_large_message
Jul 31, 2019
Merged

cameronlee314 merged 12 commits into
apache:masterfrom
PawasChhokra:changelog_large_message

Conversation

@PawasChhokra

@PawasChhokra PawasChhokra commented Apr 24, 2019 •

Copy link
Copy Markdown
Contributor

Right now, serialization of values happens after we create a CachedStore.
CachedStore does a put/putAll during flush, after it has stored the large message in its cache. This means that the large message will be stored in the cache but rejected when it reaches the addition to the changelog in the LoggedStore.
One option is to let the message remain in the cache and reject the message when it reaches the LoggedStore.
The other option is to serialize the message first in order to decipher the size of the message, then check the size of this message, and later invoke the CachedStore if required.

We are going to go ahead with both these options that the user can enable with a config value.
2 config values:
First option: expect.large.message
Second option: drop.large.messages

Behaviour (True:T, False:F):
TF, TT: throw RecordTooLargeException before adding to cached store
FT: ignore the large message (cached store will store it but it won’t be written to the db)
FF: current state as it is right now, kv store ingests the value but code breaks while adding to changelog stream

@prateekm Kindly take a look.

@PawasChhokra PawasChhokra changed the title Throw a record too large exception for oversized records in changelog SAMZA-2174: Throw a record too large exception for oversized records in changelog Apr 24, 2019
Comment thread samza-kv/src/main/scala/org/apache/samza/storage/kv/LoggedStore.scala Outdated
Comment thread samza-kv/src/main/scala/org/apache/samza/storage/kv/LoggedStore.scala Outdated
Comment thread samza-kv/src/test/scala/org/apache/samza/storage/kv/TestLoggedStore.scala Outdated
Comment thread samza-kv/src/test/scala/org/apache/samza/storage/kv/TestLoggedStore.scala Outdated
Comment thread samza-kv/src/main/scala/org/apache/samza/storage/kv/LoggedStore.scala Outdated
Comment thread samza-kv/src/main/scala/org/apache/samza/storage/kv/LargeMessageSafeStore.scala Outdated
…okra/samza into changelog_large_message

# Conflicts:
#	samza-core/src/main/scala/org/apache/samza/config/StorageConfig.scala
#	samza-kv/src/main/scala/org/apache/samza/storage/kv/BaseKeyValueStorageEngineFactory.scala
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated

@cameronlee314 cameronlee314 left a comment

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.

LGTM
@prateekm could you please take one more look?

Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html Outdated
Comment thread docs/learn/documentation/versioned/jobs/configuration-table.html
Comment thread samza-core/src/main/java/org/apache/samza/config/StorageConfig.java Outdated
Comment thread samza-kv/src/main/java/org/apache/samza/storage/kv/LargeMessageSafeStore.java Outdated
Comment thread samza-kv/src/test/java/org/apache/samza/storage/kv/TestLargeMessageSafeStore.java Outdated
Comment thread samza-kv/src/test/java/org/apache/samza/storage/kv/TestLargeMessageSafeStore.java Outdated
Comment thread samza-kv/src/test/java/org/apache/samza/storage/kv/TestLargeMessageSafeStore.java Outdated
Comment thread samza-core/src/main/java/org/apache/samza/config/StorageConfig.java Outdated
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.

6 participants