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

Allen Sooredoo commented on SOLR-14993:
---------------------------------------

Hi,

sorry about that, I wanted to do a very quick fix in github and link it
here, but it turns out I need much more time to write all the tests and
submit a proper PR.

Use case:
- I add to every configset a file called id.txt which contains the id of
the configset (positive integer)
- When I want to update it (to add new synonyms for instance), I first use `
zkClient.downloadConfig(configSetName, directory)` (Solrj) to download the
configset and check the id inside the file before proceeding.

Issue:
- If the id fits on 1 byte, the file is created by its content is not
downloaded because of this check:
```
private static int copyDataDown(SolrZkClient zkClient, String zkPath, File
file) throws IOException, KeeperException, InterruptedException { byte[]
data = zkClient.getData(zkPath, null, null, true); if (data != null && data.
length > 1) { // There are apparently basically empty ZNodes. ```
Changing it to `data.length > 0` would solve my problem, however I may need
more time to test that this "empty ZNodes" issue doesn't reappear as a side
effect.

What do you think?

--
Allen Sooredoo
Master of Science (M.Sc.)

freiheit.com technologies gmbh
Budapester Straße 45
20359 Hamburg / Germany
fon +49 40 / 890584-316
Hamburg HRB 70814

*+++ Hamburg/ Germany + Lisbon/ Portugal +++*

https://www.freiheit.com
Follow us on LinkedIn
<https://www.linkedin.com/company/freiheit-com-technologies-gmbh>

E2BF 91E0 5B29 D9F6 AA3F CE24 3D52 C42B 7D04 8487
Geschäftsführer: Claudia Dietze, Stefan Richter





> Unable to download zookeeper files of 1byte in size
> ---------------------------------------------------
>
>                 Key: SOLR-14993
>                 URL: https://issues.apache.org/jira/browse/SOLR-14993
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud, SolrJ
>    Affects Versions: 8.5.1
>            Reporter: Allen Sooredoo
>            Assignee: Erick Erickson
>            Priority: Minor
>             Fix For: 8.8
>
>
> When downloading a file from Zookeeper using the Solrj client, files of size 
> 1 byte are ignored.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to