[ 
https://issues.apache.org/jira/browse/SOLR-10151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Szantai-Kis updated SOLR-10151:
-------------------------------------
    Attachment: SOLR-10151.patch

Updated patch with method name of "getNextVersion"

> 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, 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