http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
index 061a440..d629806 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.nio.ByteBuffer;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
index cae865e..c710164 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.util.HashMap;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
index a75031f..270de23 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpPageStoreManager.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpPageStoreManager.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpPageStoreManager.java
index a179655..9d5fe69 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpPageStoreManager.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpPageStoreManager.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.nio.ByteBuffer;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpWALManager.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpWALManager.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpWALManager.java
index 5dfce5f..fec5b08 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpWALManager.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/NoOpWALManager.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import org.apache.ignite.IgniteCheckedException;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
index 6d5841b..e0fbcf4 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.io.FileOutputStream;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
index 912cd45..843aede 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplReloadSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplReloadSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplReloadSelfTest.java
index 2d654eb..7b0819a 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplReloadSelfTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplReloadSelfTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
index b3665cc..9b879e2 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.pagemem;
 
 import java.nio.ByteBuffer;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
index 0592179..b2ca19a 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateCacheTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateCacheTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateCacheTest.java
index 5152747..06ceeec 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateCacheTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateCacheTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import javax.cache.configuration.Configuration;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStreamerTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStreamerTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStreamerTest.java
index 28a167d..20ddd82 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStreamerTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStreamerTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import org.apache.ignite.Ignite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStructureTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStructureTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStructureTest.java
index d4e83d2..a33a02e 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStructureTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateDataStructureTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import java.util.concurrent.Callable;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateFailOverTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateFailOverTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateFailOverTest.java
index 112bd73..2fb5137 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateFailOverTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateFailOverTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import java.util.concurrent.Callable;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateServiceTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateServiceTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateServiceTest.java
index 5923d71..f6fbc2c 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateServiceTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateServiceTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import java.util.Collection;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateTest.java
index 7bbae98..b7dd082 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster;
 
 import java.util.Arrays;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
index 24710c1..8c9854a 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import java.lang.reflect.Method;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationAtomicCacheSuit.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationAtomicCacheSuit.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationAtomicCacheSuit.java
index d490958..397d8d0 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationAtomicCacheSuit.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationAtomicCacheSuit.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationCacheAbstractTestSuit.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationCacheAbstractTestSuit.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationCacheAbstractTestSuit.java
index 8d4ecfb..553546a 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationCacheAbstractTestSuit.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationCacheAbstractTestSuit.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationLocalAndNearCacheSuit.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationLocalAndNearCacheSuit.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationLocalAndNearCacheSuit.java
index 71bcf2c..b6ef49c 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationLocalAndNearCacheSuit.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationLocalAndNearCacheSuit.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationPartitionedCacheSuit.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationPartitionedCacheSuit.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationPartitionedCacheSuit.java
index e34ee15..fc437ad 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationPartitionedCacheSuit.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationPartitionedCacheSuit.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationReplicatedCacheSuit.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationReplicatedCacheSuit.java
 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationReplicatedCacheSuit.java
index 7636b67..6cdc87b 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationReplicatedCacheSuit.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivationReplicatedCacheSuit.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.cache.database.standbycluster.extended;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAbstractTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAbstractTest.java
new file mode 100644
index 0000000..8aa8f81
--- /dev/null
+++ 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAbstractTest.java
@@ -0,0 +1,583 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.grid.internal.processors.cache.database;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.QueryEntity;
+import org.apache.ignite.cache.QueryIndex;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.PersistenceConfiguration;
+import org.apache.ignite.events.CacheRebalancingEvent;
+import org.apache.ignite.events.EventType;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import 
org.apache.ignite.internal.processors.cache.database.wal.FileWriteAheadLogManager;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+
+/**
+ * Test for rebalancing and persistence integration.
+ */
+public abstract class CacheRebalancingWithPersistenceAbstractTest extends 
GridCommonAbstractTest {
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new 
TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    protected boolean explicitTx = false;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration ccfg1 = cacheConfiguration(null);
+        ccfg1.setBackups(1);
+        
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+        CacheConfiguration ccfg2 = cacheConfiguration("indexed");
+        ccfg2.setBackups(1);
+        
ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+        QueryEntity queryEntity = new QueryEntity(Integer.class.getName(), 
TestValue.class.getName());
+
+        LinkedHashMap<String, String> fields = new LinkedHashMap<>();
+
+        fields.put("v1", Integer.class.getName());
+        fields.put("v2", Integer.class.getName());
+
+        queryEntity.setFields(fields);
+
+        QueryIndex queryIndex = new QueryIndex("v1", true);
+
+        queryEntity.setIndexes(Collections.singleton(queryIndex));
+
+        ccfg2.setQueryEntities(Collections.singleton(queryEntity));
+
+        cfg.setCacheConfiguration(ccfg1, ccfg2);
+
+        MemoryConfiguration dbCfg = new MemoryConfiguration();
+
+        dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 
4);
+        dbCfg.setPageSize(1024);
+
+        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
+
+        memPlcCfg.setName("dfltMemPlc");
+        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setSwapFilePath("db");
+
+        dbCfg.setMemoryPolicies(memPlcCfg);
+        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
+
+        cfg.setMemoryConfiguration(dbCfg);
+
+        cfg.setPersistenceConfiguration(new PersistenceConfiguration());
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(IP_FINDER);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected long getTestTimeout() {
+        return 20 * 60 * 1000;
+    }
+
+    /**
+     * @param cacheName Cache name.
+     * @return Cache configuration.
+     */
+    protected abstract CacheConfiguration cacheConfiguration(String cacheName);
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        G.stopAll(true);
+
+        System.setProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE, 
"LOG_ONLY");
+
+        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), 
"db", false));
+
+        U.delete(new File(U.getIgniteHome(), "db"));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        G.stopAll(true);
+
+        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), 
"db", false));
+
+        U.delete(new File(U.getIgniteHome(), "db"));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        System.clearProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE);
+    }
+
+    /**
+     * Test that outdated partitions on restarted nodes are correctly replaced 
with newer versions.
+     * @throws Exception If fails.
+     */
+    public void testRebalancingOnRestart() throws Exception {
+        Ignite ignite0 = startGrid(0);
+
+        startGrid(1);
+
+        IgniteEx ignite2 = startGrid(2);
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache1 = ignite0.cache(null);
+
+        for (int i = 0; i < 5000; i++)
+            cache1.put(i, i);
+
+        ignite2.close();
+
+        awaitPartitionMapExchange();
+
+        
ignite0.resetLostPartitions(Collections.singletonList(cache1.getName()));
+
+        assert cache1.lostPartitions().isEmpty();
+
+        for (int i = 0; i < 5000; i++)
+            cache1.put(i, i * 2);
+
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+
+        info(">>> Done puts...");
+
+        ignite2 = startGrid(2);
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache3 = ignite2.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            assertEquals(String.valueOf(i), (Integer)(i * 2), cache3.get(i));
+        }
+    }
+
+    /**
+     * Test that outdated partitions on restarted nodes are correctly replaced 
with newer versions.
+     * @throws Exception If fails.
+     */
+    public void testRebalancingOnRestartAfterCheckpoint() throws Exception {
+        IgniteEx ignite0 = startGrid(0);
+
+        IgniteEx ignite1 = startGrid(1);
+
+        IgniteEx ignite2 = startGrid(2);
+        IgniteEx ignite3 = startGrid(3);
+
+        ignite0.cache(null).rebalance().get();
+        ignite1.cache(null).rebalance().get();
+        ignite2.cache(null).rebalance().get();
+        ignite3.cache(null).rebalance().get();
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache1 = ignite0.cache(null);
+
+        for (int i = 0; i < 1000; i++)
+            cache1.put(i, i);
+
+        
ignite0.context().cache().context().database().waitForCheckpoint("test");
+        
ignite1.context().cache().context().database().waitForCheckpoint("test");
+
+        info("++++++++++ After checkpoint");
+
+        ignite2.close();
+        ignite3.close();
+
+        awaitPartitionMapExchange();
+
+        
ignite0.resetLostPartitions(Collections.singletonList(cache1.getName()));
+
+        assert cache1.lostPartitions().isEmpty();
+
+        for (int i = 0; i < 1000; i++)
+            cache1.put(i, i * 2);
+
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+        info(">>>>>>>>>>>>>>>>>");
+
+        info(">>> Done puts...");
+
+        ignite2 = startGrid(2);
+        ignite3 = startGrid(3);
+
+        ignite2.cache(null).rebalance().get();
+        ignite3.cache(null).rebalance().get();
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache2 = ignite2.cache(null);
+        IgniteCache<Integer, Integer> cache3 = ignite3.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            assertEquals(String.valueOf(i), (Integer)(i * 2), cache2.get(i));
+            assertEquals(String.valueOf(i), (Integer)(i * 2), cache3.get(i));
+        }
+    }
+
+    /**
+     * Test that up-to-date partitions aren't rebalanced after cluster 
restarts gracefully.
+     * @throws Exception If fails.
+     */
+    public void testNoRebalancingOnRestartDeactivated() throws Exception {
+        fail();
+        IgniteEx ignite1 = (IgniteEx) G.start(getConfiguration("test1"));
+        IgniteEx ignite2 = (IgniteEx) G.start(getConfiguration("test2"));
+        IgniteEx ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        IgniteEx ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache1 = ignite1.cache(null);
+
+        final Collection<Integer> parts = new HashSet<>();
+
+        for (int i = 0; i < 100; i++) {
+            cache1.put(i, i);
+            parts.add(ignite1.affinity(null).partition(i));
+        }
+
+        ignite1.active(false);
+
+        ignite1.close();
+        ignite2.close();
+        ignite3.close();
+        ignite4.close();
+
+        final AtomicInteger eventCount = new AtomicInteger();
+
+        ignite1 = (IgniteEx) G.start(getConfiguration("test1"));
+
+        cache1 = ignite1.cache(null);
+
+        ignite1.active(false);
+
+        ignite1.events().remoteListen(new IgniteBiPredicate<UUID, 
CacheRebalancingEvent>() {
+            @Override public boolean apply(UUID uuid, CacheRebalancingEvent 
event) {
+                if (event.cacheName() == null && 
parts.contains(event.partition()))
+                    eventCount.incrementAndGet();
+
+                return true;
+            }
+        }, null, EventType.EVT_CACHE_REBALANCE_PART_LOADED);
+
+        ignite2 = (IgniteEx) G.start(getConfiguration("test2"));
+        ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        ignite1.active(true);
+
+        awaitPartitionMapExchange();
+
+        assert eventCount.get() == 0 : eventCount.get();
+
+        IgniteCache<Integer, Integer> cache2 = ignite2.cache(null);
+        IgniteCache<Integer, Integer> cache3 = ignite3.cache(null);
+        IgniteCache<Integer, Integer> cache4 = ignite4.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            assert cache1.get(i).equals(i);
+            assert cache2.get(i).equals(i);
+            assert cache3.get(i).equals(i);
+            assert cache4.get(i).equals(i);
+        }
+    }
+
+    /**
+     * Test that all data is correctly restored after non-graceful restart.
+     * @throws Exception If fails.
+     */
+    public void testDataCorrectnessAfterRestart() throws Exception {
+        IgniteEx ignite1 = (IgniteEx) G.start(getConfiguration("test1"));
+        IgniteEx ignite2 = (IgniteEx) G.start(getConfiguration("test2"));
+        IgniteEx ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        IgniteEx ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache1 = ignite1.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            cache1.put(i, i);
+        }
+
+        ignite1.close();
+        ignite2.close();
+        ignite3.close();
+        ignite4.close();
+
+        ignite1 = (IgniteEx) G.start(getConfiguration("test1"));
+        ignite2 = (IgniteEx) G.start(getConfiguration("test2"));
+        ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        awaitPartitionMapExchange();
+
+        cache1 = ignite1.cache(null);
+        IgniteCache<Integer, Integer> cache2 = ignite2.cache(null);
+        IgniteCache<Integer, Integer> cache3 = ignite3.cache(null);
+        IgniteCache<Integer, Integer> cache4 = ignite4.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            assert cache1.get(i).equals(i);
+            assert cache2.get(i).equals(i);
+            assert cache3.get(i).equals(i);
+            assert cache4.get(i).equals(i);
+        }
+    }
+
+    /**
+     * Test that partitions are marked as lost when all owners leave cluster, 
but recover after nodes rejoin.
+     * @throws Exception If fails.
+     */
+    public void testPartitionLossAndRecover() throws Exception {
+        Ignite ignite1 = G.start(getConfiguration("test1"));
+        Ignite ignite2 = G.start(getConfiguration("test2"));
+        IgniteEx ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        IgniteEx ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Integer, Integer> cache1 = ignite1.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            cache1.put(i, i);
+        }
+
+        ignite1.active(false);
+
+        ignite3.close();
+        ignite4.close();
+
+        ignite1.active(true);
+
+        awaitPartitionMapExchange();
+
+        assert !cache1.lostPartitions().isEmpty();
+
+        ignite3 = (IgniteEx) G.start(getConfiguration("test3"));
+        ignite4 = (IgniteEx) G.start(getConfiguration("test4"));
+
+        awaitPartitionMapExchange();
+
+        
ignite1.resetLostPartitions(Collections.singletonList(cache1.getName()));
+
+        IgniteCache<Integer, Integer> cache2 = ignite2.cache(null);
+        IgniteCache<Integer, Integer> cache3 = ignite3.cache(null);
+        IgniteCache<Integer, Integer> cache4 = ignite4.cache(null);
+
+        for (int i = 0; i < 100; i++) {
+            assert cache1.get(i).equals(i);
+            assert cache2.get(i).equals(i);
+            assert cache3.get(i).equals(i);
+            assert cache4.get(i).equals(i);
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTopologyChangesWithConstantLoad() throws Exception {
+        final int entriesCount = 10_000;
+        int maxNodesCount = 4;
+        int topChanges = 20;
+        final String cacheName = "indexed";
+
+        final AtomicBoolean stop = new AtomicBoolean();
+
+        final ConcurrentMap<Integer, TestValue> map = new 
ConcurrentHashMap<>();
+
+        Ignite ignite = startGrid(0);
+
+        IgniteCache<Integer, TestValue> cache = ignite.cache(cacheName);
+
+        for (int i = 0; i < entriesCount; i++) {
+            cache.put(i, new TestValue(i, i));
+            map.put(i, new TestValue(i, i));
+        }
+
+        final AtomicInteger nodesCount = new AtomicInteger();
+
+        IgniteInternalFuture fut = GridTestUtils.runMultiThreadedAsync(new 
Callable<Void>() {
+            @Override public Void call() throws Exception {
+                while (true) {
+                    if (stop.get())
+                        return null;
+
+                    int k = ThreadLocalRandom.current().nextInt(entriesCount);
+                    int v1 = ThreadLocalRandom.current().nextInt();
+                    int v2 = ThreadLocalRandom.current().nextInt();
+
+                    int n = nodesCount.get();
+
+                    if (n <= 0)
+                        continue;
+
+                    Ignite ignite;
+
+                    try {
+                        ignite = grid(ThreadLocalRandom.current().nextInt(n));
+                    }
+                    catch (Exception e) {
+                        continue;
+                    }
+
+                    if (ignite == null)
+                        continue;
+
+                    Transaction tx = null;
+                    boolean success = true;
+
+                    if (explicitTx) {
+                        tx = ignite.transactions().txStart();
+                    }
+
+                    try {
+                        ignite.cache(cacheName).put(k, new TestValue(v1, v2));
+                    }
+                    catch (Exception e) {
+                        success = false;
+                    }
+                    finally {
+                        if (tx != null) {
+                            try {
+                                tx.commit();
+                            }
+                            catch (Exception e) {
+                                success = false;
+                            }
+                        }
+                    }
+
+                    if (success)
+                        map.put(k, new TestValue(v1, v2));
+                }
+            }
+        }, 1, "load-runner");
+
+        for (int i = 0; i < topChanges; i++) {
+            U.sleep(3_000);
+
+            boolean add;
+            if (nodesCount.get() <= maxNodesCount / 2)
+                add = true;
+            else if (nodesCount.get() > maxNodesCount)
+                add = false;
+            else
+                add = ThreadLocalRandom.current().nextBoolean();
+
+            if (add)
+                startGrid(nodesCount.incrementAndGet());
+            else
+                stopGrid(nodesCount.getAndDecrement());
+
+            awaitPartitionMapExchange();
+
+            cache.rebalance().get();
+        }
+
+        stop.set(true);
+
+        fut.get();
+
+        awaitPartitionMapExchange();
+
+        for (Map.Entry<Integer, TestValue> entry : map.entrySet()) {
+            assertEquals(Integer.toString(entry.getKey()), entry.getValue(), 
cache.get(entry.getKey()));
+        }
+    }
+
+    private static class TestValue implements Serializable {
+        private final int v1;
+        private final int v2;
+
+        private TestValue(int v1, int v2) {
+            this.v1 = v1;
+            this.v2 = v2;
+        }
+
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            TestValue value = (TestValue)o;
+
+            if (v1 != value.v1)
+                return false;
+            return v2 == value.v2;
+
+        }
+
+        @Override public int hashCode() {
+            int result = v1;
+            result = 31 * result + v2;
+            return result;
+        }
+
+        @Override public String toString() {
+            return "TestValue{" +
+                "v1=" + v1 +
+                ", v2=" + v2 +
+                '}';
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAtomicSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAtomicSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAtomicSelfTest.java
new file mode 100644
index 0000000..ef58c72
--- /dev/null
+++ 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceAtomicSelfTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.grid.internal.processors.cache.database;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheRebalancingWithPersistenceAtomicSelfTest extends 
CacheRebalancingWithPersistenceAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String 
cacheName) {
+        CacheConfiguration ccfg = new CacheConfiguration(cacheName);
+
+        ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+        ccfg.setCacheMode(CacheMode.PARTITIONED);
+        ccfg.setBackups(1);
+        
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+        return ccfg;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceTxSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceTxSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceTxSelfTest.java
new file mode 100644
index 0000000..c91e9e6
--- /dev/null
+++ 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/CacheRebalancingWithPersistenceTxSelfTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.grid.internal.processors.cache.database;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheRebalanceMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+
+/**
+ *
+ */
+public class CacheRebalancingWithPersistenceTxSelfTest extends 
CacheRebalancingWithPersistenceAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String 
cacheName) {
+        CacheConfiguration ccfg = new CacheConfiguration(cacheName);
+
+        ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+        ccfg.setCacheMode(CacheMode.PARTITIONED);
+        ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
+        ccfg.setBackups(1);
+        ccfg.setRebalanceDelay(10_000);
+        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
+        
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+        return ccfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        explicitTx = false;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTopologyChangesWithConstantLoadExplicitTx() throws 
Exception {
+        explicitTx = true;
+
+        testTopologyChangesWithConstantLoad();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/IgniteDbContinuousRestartSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/IgniteDbContinuousRestartSelfTest.java
 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/IgniteDbContinuousRestartSelfTest.java
new file mode 100644
index 0000000..1bf8750
--- /dev/null
+++ 
b/modules/pds/src/test/java/org/apache/ignite/grid/internal/processors/cache/database/IgniteDbContinuousRestartSelfTest.java
@@ -0,0 +1,273 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.grid.internal.processors.cache.database;
+
+import java.util.Map;
+import java.util.Random;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.PersistenceConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import 
org.apache.ignite.internal.processors.cache.database.wal.FileWriteAheadLogManager;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class IgniteDbContinuousRestartSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final int GRID_CNT = 4;
+
+    /** */
+    private static final int ENTRIES_COUNT = 10_000;
+
+    /** */
+    public static final String CACHE_NAME = "cache1";
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        MemoryConfiguration dbCfg = new MemoryConfiguration();
+
+        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
+
+        memPlcCfg.setName("dfltMemPlc");
+        memPlcCfg.setSize(400 * 1024 * 1024);
+
+        dbCfg.setMemoryPolicies(memPlcCfg);
+        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
+
+        cfg.setMemoryConfiguration(dbCfg);
+
+        CacheConfiguration ccfg1 = new CacheConfiguration();
+
+        ccfg1.setName(CACHE_NAME);
+        ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+        
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg1.setAffinity(new RendezvousAffinityFunction(false, 128));
+        ccfg1.setBackups(2);
+
+        cfg.setCacheConfiguration(ccfg1);
+
+        PersistenceConfiguration pdsCfg = new PersistenceConfiguration();
+
+        cfg.setPersistenceConfiguration(pdsCfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        System.setProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE, 
"LOG_ONLY");
+
+        stopAllGrids();
+
+        deleteWorkFiles();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+
+        
System.clearProperty(IgniteSystemProperties.IGNITE_PDS_PARTITION_DESTROY_CHECKPOINT_DELAY);
+
+        deleteWorkFiles();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        System.clearProperty(FileWriteAheadLogManager.IGNITE_PDS_WAL_MODE);
+    }
+
+    /**
+     * @throws IgniteCheckedException If failed.
+     */
+    private void deleteWorkFiles() throws IgniteCheckedException {
+        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), 
"db", false));
+        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), 
"snapshot", false));
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_500_1_1() throws Exception {
+        checkRebalancingDuringLoad(1000, 500, 1, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_500_1_1() throws Exception {
+        checkRebalancingDuringLoad(8000, 500, 1, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_20000_1_1() throws Exception {
+        checkRebalancingDuringLoad(1000, 20000, 1, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_8000_1_1() throws Exception {
+        checkRebalancingDuringLoad(8000, 8000, 1, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_500_8_1() throws Exception {
+        checkRebalancingDuringLoad(1000, 500, 8, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_500_8_1() throws Exception {
+        checkRebalancingDuringLoad(8000, 500, 8, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_20000_8_1() throws Exception {
+        checkRebalancingDuringLoad(1000, 20000, 8, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_8000_8_1() throws Exception {
+        checkRebalancingDuringLoad(8000, 8000, 8, 1);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_500_8_16() throws Exception {
+        checkRebalancingDuringLoad(1000, 500, 8, 16);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_500_8_16() throws Exception {
+        checkRebalancingDuringLoad(8000, 500, 8, 16);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_1000_20000_8_16() throws Exception {
+        checkRebalancingDuringLoad(1000, 20000, 8, 16);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    public void testRebalancingDuringLoad_8000_8000_8_16() throws Exception {
+        checkRebalancingDuringLoad(8000, 8000, 8, 16);
+    }
+
+    /**
+     * @throws Exception if failed.
+     */
+    private void checkRebalancingDuringLoad(
+        int restartDelay,
+        int checkpointDelay,
+        int threads,
+        final int batch
+    ) throws Exception {
+        
System.setProperty(IgniteSystemProperties.IGNITE_PDS_PARTITION_DESTROY_CHECKPOINT_DELAY,
+            String.valueOf(checkpointDelay));
+
+        startGrids(GRID_CNT);
+
+        final Ignite load = ignite(0);
+
+        try (IgniteDataStreamer<Object, Object> s = 
load.dataStreamer(CACHE_NAME)) {
+            s.allowOverwrite(true);
+
+            for (int i = 0; i < ENTRIES_COUNT; i++)
+                s.addData(i, i);
+        }
+
+        final AtomicBoolean done = new AtomicBoolean(false);
+
+        IgniteInternalFuture<?> busyFut = 
GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+            /** {@inheritDoc} */
+            @Override
+            public Object call() throws Exception {
+                IgniteCache<Object, Object> cache = load.cache(CACHE_NAME);
+                Random rnd = ThreadLocalRandom.current();
+
+                while (!done.get()) {
+                    Map<Integer, Integer> map = new TreeMap<>();
+
+                    for (int i = 0; i < batch; i++)
+                        map.put(rnd.nextInt(ENTRIES_COUNT), rnd.nextInt());
+
+                    cache.putAll(map);
+                }
+
+                return null;
+            }
+        }, threads, "updater");
+
+        long end = System.currentTimeMillis() + 90_000;
+
+        Random rnd = ThreadLocalRandom.current();
+
+        while (System.currentTimeMillis() < end) {
+            int idx = rnd.nextInt(GRID_CNT - 1) + 1;
+
+            stopGrid(idx);
+
+            U.sleep(restartDelay);
+
+            startGrid(idx);
+
+            U.sleep(restartDelay);
+        }
+
+        done.set(true);
+
+        busyFut.get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
index ab85f4a..dd82dfa 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
index 267dbe5..9b1d926 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5eea8ada/modules/pds/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
index 17b667d..2d00061 100644
--- 
a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
+++ 
b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgniteStandByClusterSuite.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;

Reply via email to