[ 
https://issues.apache.org/jira/browse/SOLR-10151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15967541#comment-15967541
 ] 

Mano Kovacs edited comment on SOLR-10151 at 4/13/17 12:53 PM:
--------------------------------------------------------------

Thanks [~szantaikis] for taking the effort.

I see you are named the version generator method {{getVersionString}}. Would it 
make sense for you to somehow imply that it actually changes the version 
between invocations? Maybe {{incrementAndGetVersion}} or similar?


was (Author: manokovacs):
Thanks [~szantaikis] for taking the effort.

I see you are named the version generator method {{getVersionString}}. Would it 
make sense for you to somehow imply that it actually changes the version 
between invocations? Like {{incrementAndGetVersion}} or similar like that?

> TestRecovery.java - use monotonic increasing version number among all the 
> tests to avoid unintentional reordering
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-10151
>                 URL: https://issues.apache.org/jira/browse/SOLR-10151
>             Project: Solr
>          Issue Type: Test
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Mano Kovacs
>            Priority: Minor
>              Labels: newbie
>         Attachments: SOLR_10151.patch
>
>
> {{TestRecovery}} has several tests inserting updates and deletes into a 
> shared core. The tests are using fixed version number which can overlap and 
> can cause issues depending on the order of the tests.
> Proposing using a monotonically incrementing counter for each test and 
> changing tests that they would allocate the used versions would ensure that 
> later running tests would send updates with higher version only. That would 
> prevent any unintentional reordering.
> h5. Example:
> Before:
> {noformat}
> ...
> updateJ(jsonAdd(sdoc("id", "RDBQ1_1", "_version_", "1010")), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> updateJ(jsonDelQ("id:RDBQ1_2"), params(DISTRIB_UPDATE_PARAM, FROM_LEADER, 
> "_version_", "-1017")); // This should've arrived after the 1015th update
> updateJ(jsonAdd(sdoc("id", "RDBQ1_2", "_version_", "1015")), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> updateJ(jsonAdd(sdoc("id", "RDBQ1_3", "_version_", "1020")), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> ...
> {noformat}
> After:
> {noformat}
> ...
> String insVer1 = getNextVersion();
> String insVer2 = getNextVersion();
> String deleteVer = getNextVersion();
> String insVer3 = getNextVersion();
> updateJ(jsonAdd(sdoc("id", "RDBQ1_1", "_version_",insVer1)), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> updateJ(jsonDelQ("id:RDBQ1_2"), params(DISTRIB_UPDATE_PARAM, FROM_LEADER, 
> "_version_", "-"+deleteVer)); // This should've arrived after the 1015th 
> update
> updateJ(jsonAdd(sdoc("id", "RDBQ1_2", "_version_", insVer2)), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> updateJ(jsonAdd(sdoc("id", "RDBQ1_3", "_version_", insVer3)), 
> params(DISTRIB_UPDATE_PARAM, FROM_LEADER));
> ...
> {noformat}
> It might increase readability as the generation of the versions happen in the 
> preferred replay order.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to