You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Maxim Khutornenko <ma...@apache.org> on 2015/02/19 01:27:12 UTC
Review Request 31171: Saving backups asynchronously.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/
-----------------------------------------------------------
Review request for Aurora, Kevin Sweeney and Bill Farner.
Bugs: AURORA-1108
https://issues.apache.org/jira/browse/AURORA-1108
Repository: aurora
Description
-------
Wrapped backup file handling into Runnable to handle asynchronously.
Refactoring somehow triggered a findbugs warning that I had to address as well:
"Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
Diffs
-----
src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
Diff: https://reviews.apache.org/r/31171/diff/
Testing
-------
./gradlew -Pq build
Thanks,
Maxim Khutornenko
Re: Review Request 31171: Saving backups asynchronously.
Posted by Maxim Khutornenko <ma...@apache.org>.
> On Feb. 19, 2015, 1:45 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java, line 144
> > <https://reviews.apache.org/r/31171/diff/1/?file=868489#file868489line144>
> >
> > I think the defer should be here. As the diff stands, `backupNow()` returns before the backup completes, changing the behavior of an administrator RPC. Given that there's no other way for an administrator to know that a backup completed, it's best to preserve that behavior.
Good point. Moved as such.
- Maxim
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73064
-----------------------------------------------------------
On Feb. 19, 2015, 12:27 a.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 12:27 a.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73064
-----------------------------------------------------------
src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java
<https://reviews.apache.org/r/31171/#comment119247>
I think the defer should be here. As the diff stands, `backupNow()` returns before the backup completes, changing the behavior of an administrator RPC. Given that there's no other way for an administrator to know that a backup completed, it's best to preserve that behavior.
- Bill Farner
On Feb. 19, 2015, 12:27 a.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 12:27 a.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Kevin Sweeney <ke...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73055
-----------------------------------------------------------
Ship it!
Ship It!
- Kevin Sweeney
On Feb. 18, 2015, 4:27 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 18, 2015, 4:27 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Joshua Cohen <jc...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73331
-----------------------------------------------------------
Ship it!
Thanks for clarifying that assertion, it's not super obvious from a high level that that's what happens.
- Joshua Cohen
On Feb. 20, 2015, 10:48 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2015, 10:48 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73386
-----------------------------------------------------------
Ship it!
Master (e5de618) is green with this patch.
./build-support/jenkins/build.sh
I will refresh this build result if you post a review containing "@ReviewBot retry"
- Aurora ReviewBot
On Feb. 20, 2015, 10:48 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2015, 10:48 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73334
-----------------------------------------------------------
Ship it!
Ship It!
- Bill Farner
On Feb. 20, 2015, 10:48 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2015, 10:48 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Maxim Khutornenko <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/
-----------------------------------------------------------
(Updated Feb. 20, 2015, 10:48 p.m.)
Review request for Aurora, Kevin Sweeney and Bill Farner.
Changes
-------
Joshua's comments.
Bugs: AURORA-1108
https://issues.apache.org/jira/browse/AURORA-1108
Repository: aurora
Description
-------
Wrapped backup file handling into Runnable to handle asynchronously.
Refactoring somehow triggered a findbugs warning that I had to address as well:
"Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
Diffs (updated)
-----
src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
Diff: https://reviews.apache.org/r/31171/diff/
Testing
-------
./gradlew -Pq build
Thanks,
Maxim Khutornenko
Re: Review Request 31171: Saving backups asynchronously.
Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73226
-----------------------------------------------------------
Master (e0e3f2e) is red with this patch.
./build-support/jenkins/build.sh
src.test.python.apache.aurora.client.cli.sla ..... SUCCESS
src.test.python.apache.aurora.client.cli.supdate ..... SUCCESS
src.test.python.apache.aurora.client.cli.task ..... SUCCESS
src.test.python.apache.aurora.client.cli.update ..... SUCCESS
src.test.python.apache.aurora.client.cli.version ..... SUCCESS
src.test.python.apache.aurora.client.config ..... SUCCESS
src.test.python.apache.aurora.client.factory ..... SUCCESS
src.test.python.apache.aurora.client.hooks.hooked_api ..... SUCCESS
src.test.python.apache.aurora.client.hooks.non_hooked_api ..... SUCCESS
src.test.python.apache.aurora.common.test_aurora_job_key ..... SUCCESS
src.test.python.apache.aurora.common.test_cluster ..... SUCCESS
src.test.python.apache.aurora.common.test_cluster_option ..... SUCCESS
src.test.python.apache.aurora.common.test_clusters ..... SUCCESS
src.test.python.apache.aurora.common.test_http_signaler ..... SUCCESS
src.test.python.apache.aurora.common.test_pex_version ..... SUCCESS
src.test.python.apache.aurora.common.test_shellify ..... SUCCESS
src.test.python.apache.aurora.common.test_transport ..... SUCCESS
src.test.python.apache.aurora.config.test_base ..... SUCCESS
src.test.python.apache.aurora.config.test_constraint_parsing ..... SUCCESS
src.test.python.apache.aurora.config.test_loader ..... SUCCESS
src.test.python.apache.aurora.config.test_thrift ..... SUCCESS
src.test.python.apache.aurora.executor.common.announcer ..... SUCCESS
src.test.python.apache.aurora.executor.common.directory_sandbox ..... SUCCESS
src.test.python.apache.aurora.executor.common.executor_detector ..... SUCCESS
src.test.python.apache.aurora.executor.common.executor_timeout ..... SUCCESS
src.test.python.apache.aurora.executor.common.health_checker ..... FAILURE
src.test.python.apache.aurora.executor.common.path_detector ..... SUCCESS
src.test.python.apache.aurora.executor.common.task_info ..... SUCCESS
src.test.python.apache.aurora.executor.executor_base ..... SUCCESS
src.test.python.apache.aurora.executor.executor_vars ..... SUCCESS
src.test.python.apache.aurora.executor.status_manager ..... SUCCESS
src.test.python.apache.aurora.executor.thermos_task_runner ..... SUCCESS
src.test.python.apache.thermos.common.test_pathspec ..... SUCCESS
src.test.python.apache.thermos.core.test_runner_integration ..... SUCCESS
src.test.python.apache.thermos.monitoring.test_disk ..... SUCCESS
FAILURE
[31m
FAILURE[0m
I will refresh this build result if you post a review containing "@ReviewBot retry"
- Aurora ReviewBot
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
> On Feb. 20, 2015, 5:56 p.m., Joshua Cohen wrote:
> > Is it worth adding a test to StorageBackupTest asserting that we write the backup asynchronously (i.e. some expectation on the mock executor service)?
>
> Bill Farner wrote:
> This is not a bad idea. I wouldn't venture so far to actually use multiple threads, but you could have one test case where the executor swallows the task to prove that the backup is not writen.
>
> Maxim Khutornenko wrote:
> This is already tested by relying on a FakeScheduledExecutor mocking the `execute()`. If it was not mocked tests would fail with:
> ```
> java.lang.AssertionError:
> Unexpected method call ScheduledExecutorService.execute(org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1@2c7614d6):
> at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44)
> at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:94)
> at com.sun.proxy.$Proxy7.execute(Unknown Source)
> at org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl.createSnapshot(StorageBackup.java:141)
> ...
> ```
Well, i was going a step further and suggesting we test that the executor service is used for the write as opposed to something else. Though that may be a bit too paranoid.
- Bill
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73291
-----------------------------------------------------------
On Feb. 20, 2015, 10:48 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2015, 10:48 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
> On Feb. 20, 2015, 5:56 p.m., Joshua Cohen wrote:
> > Is it worth adding a test to StorageBackupTest asserting that we write the backup asynchronously (i.e. some expectation on the mock executor service)?
This is not a bad idea. I wouldn't venture so far to actually use multiple threads, but you could have one test case where the executor swallows the task to prove that the backup is not writen.
- Bill
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73291
-----------------------------------------------------------
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Maxim Khutornenko <ma...@apache.org>.
> On Feb. 20, 2015, 5:56 p.m., Joshua Cohen wrote:
> > Is it worth adding a test to StorageBackupTest asserting that we write the backup asynchronously (i.e. some expectation on the mock executor service)?
>
> Bill Farner wrote:
> This is not a bad idea. I wouldn't venture so far to actually use multiple threads, but you could have one test case where the executor swallows the task to prove that the backup is not writen.
This is already tested by relying on a FakeScheduledExecutor mocking the `execute()`. If it was not mocked tests would fail with:
```
java.lang.AssertionError:
Unexpected method call ScheduledExecutorService.execute(org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1@2c7614d6):
at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44)
at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:94)
at com.sun.proxy.$Proxy7.execute(Unknown Source)
at org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl.createSnapshot(StorageBackup.java:141)
...
```
> On Feb. 20, 2015, 5:56 p.m., Joshua Cohen wrote:
> > src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java, line 75
> > <https://reviews.apache.org/r/31171/diff/2/?file=869997#file869997line75>
> >
> > I think this assignment obviates the need to assign to a new FakeClock above?
Good catch. Done.
- Maxim
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73291
-----------------------------------------------------------
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Joshua Cohen <jc...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73291
-----------------------------------------------------------
Is it worth adding a test to StorageBackupTest asserting that we write the backup asynchronously (i.e. some expectation on the mock executor service)?
src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java
<https://reviews.apache.org/r/31171/#comment119559>
I think this assignment obviates the need to assign to a new FakeClock above?
- Joshua Cohen
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
> On Feb. 20, 2015, 12:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java, line 261
> > <https://reviews.apache.org/r/31171/diff/2/?file=869995#file869995line261>
> >
> > It may exceed your appetite for this review, but i would actually prefer that this transaction be opened at the origin of the operation. This would mean `createSnapshot()` might be best to accept a `StoreProvider`, and allow the caller to decide whether that provider is part of a read or write transaction. If you follow this for `applySnapshot` as well, it could accept `MutableStoreProvider` and have no need to inject `Storage`.
(fwiw this advice is in line with other recent refactors [1] to push transactions up)
[1] https://reviews.apache.org/r/26899/
- Bill
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73225
-----------------------------------------------------------
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Maxim Khutornenko <ma...@apache.org>.
> On Feb. 20, 2015, 12:06 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java, line 261
> > <https://reviews.apache.org/r/31171/diff/2/?file=869995#file869995line261>
> >
> > It may exceed your appetite for this review, but i would actually prefer that this transaction be opened at the origin of the operation. This would mean `createSnapshot()` might be best to accept a `StoreProvider`, and allow the caller to decide whether that provider is part of a read or write transaction. If you follow this for `applySnapshot` as well, it could accept `MutableStoreProvider` and have no need to inject `Storage`.
>
> Bill Farner wrote:
> (fwiw this advice is in line with other recent refactors [1] to push transactions up)
>
> [1] https://reviews.apache.org/r/26899/
For posterity: SnapshotStoreImpl uses a @Volatile storage instance, which cannot be enforced at all call sites (e.g. LogStorage).
- Maxim
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73225
-----------------------------------------------------------
On Feb. 20, 2015, 10:48 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2015, 10:48 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Bill Farner <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73225
-----------------------------------------------------------
src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
<https://reviews.apache.org/r/31171/#comment119486>
It may exceed your appetite for this review, but i would actually prefer that this transaction be opened at the origin of the operation. This would mean `createSnapshot()` might be best to accept a `StoreProvider`, and allow the caller to decide whether that provider is part of a read or write transaction. If you follow this for `applySnapshot` as well, it could accept `MutableStoreProvider` and have no need to inject `Storage`.
- Bill Farner
On Feb. 19, 2015, 11:58 p.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 11:58 p.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>
Re: Review Request 31171: Saving backups asynchronously.
Posted by Maxim Khutornenko <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/
-----------------------------------------------------------
(Updated Feb. 19, 2015, 11:58 p.m.)
Review request for Aurora, Kevin Sweeney and Bill Farner.
Changes
-------
Bill's comments.
Also, realized the backup path is no longer covered by a write lock, added it in createSnapshot().
Bugs: AURORA-1108
https://issues.apache.org/jira/browse/AURORA-1108
Repository: aurora
Description
-------
Wrapped backup file handling into Runnable to handle asynchronously.
Refactoring somehow triggered a findbugs warning that I had to address as well:
"Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
Diffs (updated)
-----
src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java ea33037d86f30f0787136f34dad34b88eceb0a4d
src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
Diff: https://reviews.apache.org/r/31171/diff/
Testing
-------
./gradlew -Pq build
Thanks,
Maxim Khutornenko
Re: Review Request 31171: Saving backups asynchronously.
Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31171/#review73044
-----------------------------------------------------------
Ship it!
Master (e0e3f2e) is green with this patch.
./build-support/jenkins/build.sh
I will refresh this build result if you post a review containing "@ReviewBot retry"
- Aurora ReviewBot
On Feb. 19, 2015, 12:27 a.m., Maxim Khutornenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31171/
> -----------------------------------------------------------
>
> (Updated Feb. 19, 2015, 12:27 a.m.)
>
>
> Review request for Aurora, Kevin Sweeney and Bill Farner.
>
>
> Bugs: AURORA-1108
> https://issues.apache.org/jira/browse/AURORA-1108
>
>
> Repository: aurora
>
>
> Description
> -------
>
> Wrapped backup file handling into Runnable to handle asynchronously.
>
> Refactoring somehow triggered a findbugs warning that I had to address as well:
> "Exceptional return value of java.io.File.delete() ignored in org.apache.aurora.scheduler.storage.backup.StorageBackup$StorageBackupImpl$1.run()"
>
>
> Diffs
> -----
>
> src/main/java/org/apache/aurora/scheduler/storage/backup/BackupModule.java 71feb5779df5738a92e587f9f66f915961f52d1d
> src/main/java/org/apache/aurora/scheduler/storage/backup/StorageBackup.java a20378a01575c399c23c86aa784424fc6909c34e
> src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java 7602d112d29454608a97ec81de14b6bf0c45df68
> src/test/java/org/apache/aurora/scheduler/storage/backup/StorageBackupTest.java 15fc4404fa2ace4391e4ddc7153c848bc91d43df
>
> Diff: https://reviews.apache.org/r/31171/diff/
>
>
> Testing
> -------
>
> ./gradlew -Pq build
>
>
> Thanks,
>
> Maxim Khutornenko
>
>