Repository navigation
CLOUDSTACK-8988: Removed unused adapters from async-job-component.xml. - #943
Conversation
|
@rodrigo93, nice work. However, you forgot an entry in /cloud-client-ui/pom.xml. Additionally, could you squash your commits? |
|
@rafaelweingartner Thanks for the advice! I am squashing them right now. I will commit again as soon as possible. |
da0be68 to
0a315a8
Compare
0a315a8 to
bb23cdf
Compare
4adc1e8 to
557f541
Compare
|
@rodrigo93 Thanks for squashing! Could you also rename the commit title to something more sensible? |
|
@borisroman Hi borisroman, sure! What about this one? |
|
@rodrigo93 You changed the PR title, not the commit title. :) |
|
I'm with @borisroman the commit title "Squashing last commits" is not descriptive of what this commit is about so please change it. You can use the same as the title of the PR. Consider making a Jira issue and prepend the ticket in the title of the PR. |
557f541 to
084c0b4
Compare
|
Hi @remibergsma, thanks for the advice! Thanks once again! |
|
Thanks @rodrigo93, please also rebase with current master. |
|
Hi @remibergsma, the files that I am changing were not altered in the current master. Why do we need to rebase? |
|
@rodrigo93 it helps when running the tests. But never mind, I will rebase myself and then run the tests :-) |
|
@remibergsma I see. Next time I will try to rebase it with master before commiting. |
084c0b4 to
2106c45
Compare
|
Commit merged with master. |
|
Hi @rodrigo93 in the comments above it was suggested to change the commit title, can you do that please? The commit title is the first line of the commit message, and that should be max about 70 characters long. Followed by an empty line, and then whatever it is you want to say more (probably what you start with now). In short: add a short descriptive title and an empty line and force push the commit again. Ping me and I'll run soms tests on this branch. Thanks! |
2106c45 to
a050f76
Compare
|
Hi @remibergsma. Thanks for the reminding! I was merging that commit with that actual master and I forgot to put the title in the commit. |
bb23cdf to
6cb878b
Compare
|
PR rebased and commits squashed for @rodrigo93 |
|
I am not sure if this allocator is used any where. As it is injected by it's interface StoragePoolAllocator, it will be a choice to use from a list. It is likely not to be used as it is clearly not properly configured. Someone might have fixed it locally however. I am not keen on deletion an option for users. |
|
@rodrigo93 Jenkins can not merge this to master. please have a look. |
|
@DaanHoogland, I got your point. |
3b49573 to
2601d64
Compare
2601d64 to
49f5a6b
Compare
|
looks good, waiting on jenkins and will ask @remibergsma to schedule integration tests. |
|
Hi guys. |
|
there is a merge conflict @rodrigo93 . can you resolve it please? |
|
@DaanHoogland , where did you see the merge conflict Daan ? I did not find it. |
|
@DaanHoogland Can you tell us where the conflict is? It seems ok to me. |
|
@rafaelweingartner @rodrigo93 my bad I was merging against 4.6, not master. So far it has 0ne failure. I think it is a false positive so I am rerunning that test. |
|
943.vm.results.txt |
|
@DaanHoogland, The VMs were marked as destroyed, but it seems that they have not been “destroyed” or removed/expunged yet. I looked at the code, and the only way that they are removed from the response of the list VMs methods is after the expunge thread execution that fills out the “removed” field in the database. I also looked at the code of the integration tests, my perl is a little rusty, but I noticed that the code waits a few cycles (2) of the expunge delay to execute; therefore, there is no way to guarantee that the expunge thread has already been executed and the VM has passed the expunge delay and has been removed. If I recall properly, there are mainly three (3) variables in play, the time that the VM was destroyed, the expunge delay per se and the expunge interval (the interval of the expunge thread execution). So, if the expunge thread runs, but the VM has been destroyed too recently and has not passed the expunge delay, it will not be marked as destroyed. That is what seems to have happened there. I know some people may come and say, “the test worked a lot of time”. And yes it can work, but it depends if you are luck or not. I personally do not like tests that may present this kind of behavior. Moreover, the expunge interval depends on the time that the MS has been started. I will illustrate it with an example that we have seen happening here. Having said that, I have the following questions, what do we want with that test? We want to test the expunge thread? Or just test If the destroyed VM is not listed? If we want the second, why don’t we force the expunging (using expungeVirtualMachine command) instead of waiting the expunge thread? If the idea is to let the test as it is, to avoid the problem I have just described, we could just change a "bit" of the file test_vm_life_cycle the multiplier, in line 632 from “4” to “6” . That change would guarantee to wait till the third execution of the expunge thread, and avoid cases as the one described. |
|
@rafaelweingartner I agree with you in general lines. In this case the test had not just succeeded so far, it also started failing a lot since a few days. So something has definitely changed. I had not looked at the implemetation of the test to see the root cause yet but will have a look. |
|
@DaanHoogland with your explanation I now understand that we want to test if the expunge thread is being executed and if it is doing its job. Therefore, I believe that properly setting the wait period before checking if the VM was remove should do the trick. Before changing anything, I would like to check the configuration of expunge interval and expunge delay that are being used in the test MS. However, I did not find the file they are being configured (I am really not good reading perl). |
|
@rafaelweingartner it is python not perl :) it is being read from the ms, and for the proper execution of the test it is not important what exactly it is, is it? Correction: in the test environment it is set into the ms from the defintion or left default. For this test that is unlikely as the test would take to long. in https://github.com/schubergphilis/MCT-shared/blob/master/marvin/mct-zone1-kvm1-kvm2.cfg you can see it being set to 5 seconds. |
|
Oh sorry, I do not know why, but I thought it was perl. Well, if those configurations parameter are being taken from the MS, they are not important. I thought they were being taken from a configuration file, that is why I tried to look for them. I have found a file called configGenerator (line542) that seems to set those configurations to 60, but that maybe just a default configuration. |
|
@rafaelweingartner I tested #942 with the setting of expunge * 6 but the same test still failed on that PR. I am convinced it has nothing to do with the code of these PRs. |
|
That is odd, because the log you sent me earlier, the VM was marked as destroyed, so it was just a matter of executing the expunge thread. Is it possible for you to send me your MS logs? So I can tried to follow the execution of the expunge thread code. |
|
I ran #942 with a slimmed down version of the test file containing only the expunge test with a factor of 9. I will do some looking into 943 now and edit the test back to the original until it fails. If it does I'll share the stuff. |
There was a problem hiding this comment.
Not sure about this, anyone using this?
There was a problem hiding this comment.
@bhaisaab , probably note (I would say that no one uses it) that class does not exist.
|
LGTM as these integration tests still pass: Result: And: Result: |
|
@DaanHoogland @rafaelweingartner The failed expunge test was a false alarm due to our testing environment. It passes again now. Please ping me when there's another review so I can merge. Thanks! |
|
LGTM, ran the tests as well and reviewed. |
CLOUDSTACK-8988: Removed unused adapters from async-job-component.xml.I was looking the file /cloud-server/test/async-job-component.xml, and I found an adapter configuration that seems to have no use. The reason for that is explained as follows.
The adapter configuration is the following:
<*adapters key="com.cloud.agent.manager.allocator.StorageAllocator"*>
<*adapter name="Storage"
class="com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator"*>
<*param name="storage.overprovisioning.factor"*>2<*/param*>
<*/adapter*>
<*adapter name="
class="com.cloud.agent.manager.allocator.impl.RandomStoragePoolAllocator"*>
<*param name="storage.overprovisioning.factor"*>2<*/param*>
<*/adapter*>
<*/adapters*>
class="com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator"
The class "com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator" does not exist. The only reference for it is found in the following file:
- /cloud-server/test/async-job-component.xml
Therefore, we can conclude that there is no need for this line at that file.
class="com.cloud.agent.manager.allocator.impl.RandomStoragePoolAllocator"
Additionally, the class RandomStoragePoolAllocator.java is never used. The only reference is found in the following file:
- /cloud-server/test/async-job-component.xml
I found a project called cloud-plugin-storage-allocator-random. This project has only one package that contains only one class, which is the RandomStoragePoolAllocator.java. Despite the names that are the same, the class in cloud-plugin-storage-allocator-random project and the class referenced in - /cloud-server/test/async-job-component.xml have different packages. Therefore, I removed that configuration from async-job-component.xml and the project that contains only the RandomStoragePoolAllocator class that is never used.
Consequently, I had to remove the following lines from the */cloud-client-ui/pom.xml*:
<*dependency*>
<*groupId*>org.apache.cloudstack<*/groupId*>
<*artifactId*>cloud-plugin-storage-allocator-random<*/artifactId*>
<*version*>${project.version}<*/version*>
<*/dependency*>
Furthermore, after I removed that configuration I noticed that there is no such class StorageAllocator.java. However, it appears that exists test for it, like the following classes:
- StorageAllocatorTestConfiguration.java
- StorageAllocatorTest.java.
I am not sure if these classes are tests for the class StorageAllocator.java and for the possible configuration I have just removed. If they are, we can remove both classes. Can someone help me on checking that?
* pr/943:
fixed references in async-job-component.xml for storage allocators
Signed-off-by: Remi Bergsma <github@remi.nl>
|
Many thanks for the help everyone! |
I was looking the file /cloud-server/test/async-job-component.xml, and I found an adapter configuration that seems to have no use. The reason for that is explained as follows.
The adapter configuration is the following:
<adapters key="com.cloud.agent.manager.allocator.StorageAllocator">
<adapter name="Storage"
class="com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator">
<param name="storage.overprovisioning.factor">2</param>
</adapter>
<adapter name="
class="com.cloud.agent.manager.allocator.impl.RandomStoragePoolAllocator">
<param name="storage.overprovisioning.factor">2</param>
</adapter>
</adapters>
• class="com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator"
The class "com.cloud.agent.manager.allocator.impl.FirstFitStorageAllocator" does not exist. The only reference for it is found in the following file:
- /cloud-server/test/async-job-component.xml
Therefore, we can conclude that there is no need for this line at that file.
• class="com.cloud.agent.manager.allocator.impl.RandomStoragePoolAllocator"
Additionally, the class RandomStoragePoolAllocator.java is never used. The only reference is found in the following file:
I found a project called “cloud-plugin-storage-allocator-random”. This project has only one package that contains only one class, which is the RandomStoragePoolAllocator.java. Despite the names that are the same, the class in “cloud-plugin-storage-allocator-random” project and the class referenced in - /cloud-server/test/async-job-component.xml have different packages. Therefore, I removed that configuration from async-job-component.xml and the project that contains only the RandomStoragePoolAllocator class that is never used.
Consequently, I had to remove the following lines from the /cloud-client-ui/pom.xml:
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-allocator-random</artifactId>
<version>${project.version}</version>
</dependency>
Furthermore, after I removed that configuration I noticed that there is no such class StorageAllocator.java. However, it appears that exists test for it, like the following classes:
I am not sure if these classes are tests for the class StorageAllocator.java and for the possible configuration I have just removed. If they are, we can remove both classes. Can someone help me on checking that?