Skip to content

Conversation

skisel
Copy link
Contributor

@skisel skisel commented Oct 19, 2016

PR to fix the problem mentioned in #21704

@akka-ci
Copy link

akka-ci commented Oct 19, 2016

Can one of the repo owners verify this patch?

@johanandren
Copy link
Contributor

OK TO TEST

@johanandren
Copy link
Contributor

Isn't the limit of 10k just as arbitrary as the 4k limit you stumbled upon?

@skisel
Copy link
Contributor Author

skisel commented Oct 21, 2016

Yes, it is quite arbitrary, but I stumbled upon 4K. I can change it 4k if you want, but this is oracle specific. We could try bigger snapshot actually.

@akka-ci akka-ci added the validating PR is currently being validated by Jenkins label Oct 21, 2016
@johanandren
Copy link
Contributor

What I am hinting towards is maybe a single limit should not be enforced by the tck, what if it makes some persistence impl impossible?

WDYT @ktoso @patriknw

@akka-ci akka-ci added the tested PR that was successfully built and tested by Jenkins label Oct 21, 2016
@akka-ci
Copy link

akka-ci commented Oct 21, 2016

Test PASSed.

@akka-ci akka-ci removed the validating PR is currently being validated by Jenkins label Oct 21, 2016
@patriknw
Copy link
Contributor

patriknw commented Oct 21, 2016

I suggest to place the limit in a method that can be overridden. 10k sounds like a good default requirement

@skisel skisel force-pushed the wip-21704-akka-persistence-tck-plugin-spec-extention branch from 98d4b57 to 0a9ea16 Compare October 21, 2016 14:35
@akka-ci akka-ci added validating PR is currently being validated by Jenkins and removed tested PR that was successfully built and tested by Jenkins labels Oct 21, 2016
@skisel
Copy link
Contributor Author

skisel commented Oct 21, 2016

Extracted the limit into the method.

@skisel
Copy link
Contributor Author

skisel commented Oct 21, 2016

Oh just realised I made it 10000, shall I change it to 10 * 1024 ?

@akka-ci akka-ci added tested PR that was successfully built and tested by Jenkins and removed validating PR is currently being validated by Jenkins labels Oct 21, 2016
@akka-ci
Copy link

akka-ci commented Oct 21, 2016

Test PASSed.

Copy link
Contributor

@patriknw patriknw left a comment

Choose a reason for hiding this comment

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

LGTM, with one nitpick

s"save bigger size snapshot ($snapshotByteSizeLimit bytes)" in {
val metadata = SnapshotMetadata(pid, 100)
val bigSnapshot = for { i ← 1 to snapshotByteSizeLimit } yield '0'
snapshotStore.tell(SaveSnapshot(metadata, bigSnapshot.mkString("")), senderProbe.ref)
Copy link
Contributor

Choose a reason for hiding this comment

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

a more compact way of creating the String:

"0" * snapshotByteSizeLimit

@skisel skisel force-pushed the wip-21704-akka-persistence-tck-plugin-spec-extention branch from 0a9ea16 to 4654e17 Compare October 24, 2016 10:58
@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed tested PR that was successfully built and tested by Jenkins labels Oct 24, 2016
@akka-ci
Copy link

akka-ci commented Oct 24, 2016

Test PASSed.

@akka-ci akka-ci removed the validating PR is currently being validated by Jenkins label Oct 24, 2016
@412b
Copy link
Contributor

412b commented Oct 25, 2016

I'm sorry for bumping in, but as we had similar problems with persistence (cassandra backend to be precise) I see it being a dead path. I've ended up writing our custom cassandra persistence impl that splits payload into chunks of configurable size to overcome cassandra limitations. That said, perhaps, it makes sense to reconsider the schema and persistence jdbc impl. And also there is no limit for message size documented for persistence (of course, common sense etc), so this looks like an artificial limitation, imho.

@skisel
Copy link
Contributor Author

skisel commented Oct 25, 2016

Having this integration test as part of akka-persistence-tck package will highlight the limit explicitly, and if test fails for some of the implementations, you might always override the limit for your plugin and then make a note in your plugin documentation that it supports only X bytes snapshots.

@patriknw
Copy link
Contributor

exactly, that is the purpose of the tck - many things will be optional (but they should not be accidental)

Copy link
Contributor

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

LGTM, but a small scaladoc would be nice

@@ -52,6 +52,8 @@ abstract class SnapshotStoreSpec(config: Config) extends PluginSpec(config)
}
}

def snapshotByteSizeLimit = 10000
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a scaladoc on this mentioning that it can be overridden to a limit suitable for the specific implementation but that authors should also document that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will do it.

@skisel skisel force-pushed the wip-21704-akka-persistence-tck-plugin-spec-extention branch from 4654e17 to 12a2ca6 Compare October 26, 2016 19:24
@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed tested PR that was successfully built and tested by Jenkins validating PR is currently being validated by Jenkins labels Oct 26, 2016
@akka-ci
Copy link

akka-ci commented Oct 26, 2016

Test PASSed.

@johanandren
Copy link
Contributor

Thanks @skisel !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants