|
53 | 53 | import java.util.concurrent.atomic.AtomicInteger; |
54 | 54 | import org.apache.commons.io.FileUtils; |
55 | 55 | import org.apache.commons.io.IOUtils; |
56 | | -import org.apache.commons.lang3.tuple.Pair; |
57 | 56 | import org.apache.hadoop.fs.FileUtil; |
58 | 57 | import org.apache.hadoop.hdds.HddsUtils; |
59 | 58 | import org.apache.hadoop.hdds.client.ReplicationConfig; |
|
88 | 87 | import org.apache.hadoop.ozone.container.TestHelper; |
89 | 88 | import org.apache.hadoop.ozone.container.common.impl.ContainerData; |
90 | 89 | import org.apache.hadoop.ozone.container.common.impl.ContainerDataYaml; |
91 | | -import org.apache.hadoop.ozone.container.common.impl.ContainerSet; |
92 | 90 | import org.apache.hadoop.ozone.container.common.impl.HddsDispatcher; |
93 | 91 | import org.apache.hadoop.ozone.container.common.interfaces.Container; |
94 | 92 | import org.apache.hadoop.ozone.container.common.transport.server.ratis.ContainerStateMachine; |
95 | 93 | import org.apache.hadoop.ozone.container.common.transport.server.ratis.XceiverServerRatis; |
96 | | -import org.apache.hadoop.ozone.container.common.volume.StorageVolume; |
97 | | -import org.apache.hadoop.ozone.container.common.volume.VolumeUsage; |
98 | 94 | import org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData; |
99 | 95 | import org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer; |
100 | 96 | import org.apache.hadoop.ozone.om.helpers.OmKeyArgs; |
101 | 97 | import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; |
102 | 98 | import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo; |
103 | 99 | import org.apache.hadoop.ozone.protocol.commands.CloseContainerCommand; |
104 | 100 | import org.apache.hadoop.ozone.protocol.commands.SCMCommand; |
105 | | -import org.apache.hadoop.util.Time; |
106 | 101 | import org.apache.ozone.test.GenericTestUtils; |
107 | 102 | import org.apache.ozone.test.LambdaTestUtils; |
108 | 103 | import org.apache.ozone.test.tag.Flaky; |
@@ -140,7 +135,7 @@ public static void init() throws Exception { |
140 | 135 | TimeUnit.MILLISECONDS); |
141 | 136 | conf.setTimeDuration(HDDS_COMMAND_STATUS_REPORT_INTERVAL, 200, |
142 | 137 | TimeUnit.MILLISECONDS); |
143 | | - conf.setTimeDuration(HDDS_PIPELINE_REPORT_INTERVAL, 2000, |
| 138 | + conf.setTimeDuration(HDDS_PIPELINE_REPORT_INTERVAL, 200, |
144 | 139 | TimeUnit.MILLISECONDS); |
145 | 140 | conf.setTimeDuration(HDDS_HEARTBEAT_INTERVAL, 200, TimeUnit.MILLISECONDS); |
146 | 141 | conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 30, TimeUnit.SECONDS); |
@@ -770,14 +765,9 @@ void testContainerStateMachineSingleFailureRetry() |
770 | 765 | assertEquals(1, locationInfoList.size()); |
771 | 766 |
|
772 | 767 | OmKeyLocationInfo omKeyLocationInfo = locationInfoList.get(0); |
773 | | - ContainerSet containerSet = cluster.getHddsDatanode(omKeyLocationInfo.getPipeline().getLeaderNode()) |
774 | | - .getDatanodeStateMachine().getContainer().getContainerSet(); |
775 | 768 |
|
776 | 769 | induceFollowerFailure(omKeyLocationInfo, 2); |
777 | 770 | key.flush(); |
778 | | - // wait for container close for failure in flush for both followers applyTransaction failure |
779 | | - GenericTestUtils.waitFor(() -> containerSet.getContainer(omKeyLocationInfo.getContainerID()).getContainerData() |
780 | | - .getState().equals(ContainerProtos.ContainerDataProto.State.CLOSED), 100, 30000); |
781 | 771 | key.write("ratis".getBytes(UTF_8)); |
782 | 772 | key.flush(); |
783 | 773 | } |
@@ -817,59 +807,6 @@ void testContainerStateMachineDualFailureRetry() |
817 | 807 | validateData("ratis1", 2, "ratisratisratisratis"); |
818 | 808 | } |
819 | 809 |
|
820 | | - @Test |
821 | | - void testContainerStateMachineAllNodeFailure() |
822 | | - throws Exception { |
823 | | - // mark all dn volume as full to induce failure |
824 | | - List<Pair<VolumeUsage, Long>> increasedVolumeSpace = new ArrayList<>(); |
825 | | - cluster.getHddsDatanodes().forEach( |
826 | | - dn -> { |
827 | | - List<StorageVolume> volumesList = dn.getDatanodeStateMachine().getContainer().getVolumeSet().getVolumesList(); |
828 | | - volumesList.forEach(sv -> { |
829 | | - final VolumeUsage volumeUsage = sv.getVolumeUsage(); |
830 | | - if (volumeUsage != null) { |
831 | | - final long available = sv.getCurrentUsage().getAvailable(); |
832 | | - increasedVolumeSpace.add(Pair.of(volumeUsage, available)); |
833 | | - volumeUsage.incrementUsedSpace(available); |
834 | | - } |
835 | | - }); |
836 | | - } |
837 | | - ); |
838 | | - |
839 | | - long startTime = Time.monotonicNow(); |
840 | | - ReplicationConfig replicationConfig = ReplicationConfig.fromTypeAndFactor(ReplicationType.RATIS, |
841 | | - ReplicationFactor.THREE); |
842 | | - try (OzoneOutputStream key = objectStore.getVolume(volumeName).getBucket(bucketName).createKey( |
843 | | - "testkey1", 1024, replicationConfig, new HashMap<>())) { |
844 | | - |
845 | | - key.write("ratis".getBytes(UTF_8)); |
846 | | - key.flush(); |
847 | | - fail(); |
848 | | - } catch (IOException ex) { |
849 | | - assertThat(ex.getMessage()).contains("Retry request failed. retries get failed due to exceeded" + |
850 | | - " maximum allowed retries number: 5"); |
851 | | - } finally { |
852 | | - increasedVolumeSpace.forEach(e -> e.getLeft().decrementUsedSpace(e.getRight())); |
853 | | - // test execution is less than 2 sec but to be safe putting 30 sec as without fix, taking more than 60 sec |
854 | | - assertThat(Time.monotonicNow() - startTime) |
855 | | - .describedAs("Operation took longer than expected") |
856 | | - .isLessThan(30000); |
857 | | - } |
858 | | - |
859 | | - // previous pipeline gets closed due to disk full failure, so created a new pipeline and write should succeed, |
860 | | - // and this ensures later test case can pass (should not fail due to pipeline unavailability as timeout is 200ms |
861 | | - // for pipeline creation which can fail in testcase later on) |
862 | | - Pipeline pipeline = cluster.getStorageContainerManager().getPipelineManager().createPipeline(replicationConfig); |
863 | | - cluster.getStorageContainerManager().getPipelineManager().waitPipelineReady(pipeline.getId(), 60000); |
864 | | - |
865 | | - try (OzoneOutputStream key = objectStore.getVolume(volumeName).getBucket(bucketName).createKey( |
866 | | - "testkey2", 1024, replicationConfig, new HashMap<>())) { |
867 | | - |
868 | | - key.write("ratis".getBytes(UTF_8)); |
869 | | - key.flush(); |
870 | | - } |
871 | | - } |
872 | | - |
873 | 810 | private void induceFollowerFailure(OmKeyLocationInfo omKeyLocationInfo, |
874 | 811 | int failureCount) { |
875 | 812 | DatanodeID leader = omKeyLocationInfo.getPipeline().getLeaderId(); |
|
0 commit comments