Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(couchdb): Support CouchDb Lucene 2.1.0 with CouchDb 2.1.2 and backward compatibility #926

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

JaideepPalit
Copy link
Contributor

@JaideepPalit JaideepPalit commented Jul 21, 2020

Support CouchDb Lucene 2.1.0 with CouchDb 2.1.2 and backward compatibility

Issue:

How To Test?

Install CouchDb lucene 2.1.0 - Couch DB 2.1.2 follow wiki,
Search Functionality should be working fine
couchdb.lucene.url = http://localhost:8080/couchdb-lucene can be added to couchdb.properties in /etc/sw360 to override default value

Backward Compatibility
Install CouchDb lucene 1.0.2 - Couch DB 1.6.0 follow wiki, Add _fti hook to /etc/couchdb/local.ini of couchdb .

[httpd_global_handlers]
_fti = {couch_httpd_proxy, handle_proxy_req, <<"http://[TOMCAT_INSTANCE]/couchdb-lucene">>}

Search Functionality should be working fine

Steps to deploy couchdb-lucene

  1. Download and rename src from github
  2. Extract src
    • tar -xzf couchdb-lucene.tar.gz
  3. cd couchdb-lucene-2.1.0
  4. Edit and make changes to couchdb-lucene.ini not required for local setup
    • vim ./src/main/resources/couchdb-lucene.ini
  5. Download patch
  6. Apply patch
    • patch -p1 < couchdb-lucene.patch
  7. Build sources
    • mvn clean install war:war
  8. Copy and rename war file to webapps
    • cp ./target/*.war ///webapps/couchdb-lucene.war

Have you implemented any additional tests? - No

Checklist

Must:

  • All related issues are referenced in commit messages and in PR

Signed-off-by: Jaideep Palit [email protected]

@JaideepPalit JaideepPalit added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Jul 21, 2020
@smrutis1 smrutis1 self-assigned this Jul 28, 2020
@mcjaeger
Copy link
Contributor

mcjaeger commented Aug 7, 2020

I am not sure, if the provided information is sufficient to test this branch successfully:

  • install this branch
  • install couchdb 2.1.2 on xenial (which is an attempt on its own)
  • install couchdb-lucene 2.1 built from source (download release source from github and then remove old lucene and install new lucene with mvn war:warby copying the artefact.
  • renamed the artefact, but it is not necessary, because the web.xmldefined the URL path accordingly
  • create couchdb.properties in /etc/sw360 with the above mentioned data

-> search does not work, see screenshot. I suspect that some configuration information is missing.

@mcjaeger
Copy link
Contributor

mcjaeger commented Aug 7, 2020

screenshot:

Screenshot 2020-08-07 at 23 42 16

@mcjaeger
Copy link
Contributor

mcjaeger commented Aug 7, 2020

BTW. if someone else attmepts to try it. some notes about the couchdb installation. Very disappointing, if you go for the official page:

Screenshot 2020-08-07 at 23 47 39

it points you to the page where you can install couchdb 3.1 (on xenial). There is no way to install any version of couchdb 2.x just from packages in an obviousway. I downloaded the deb file from:

https://apache.bintray.com/couchdb-deb/pool/C/CouchDB/couchdb_2.1.2~xenial_amd64.deb

or after adding the ppa:

sudo  apt-get install -y couchdb=2.1.2~xenial

The couchup commands are

couchup list
couchup replicate -a
couchup rebuild -a

however, if this fails at one database it stops and you can start executing this for any of the remaining databases manually (instead of the -a). Would have been nice if that would continue with the next database.

@mcjaeger
Copy link
Contributor

mcjaeger commented Aug 7, 2020

after a clean vagrant setup (with manual installation of couchdb lucene and couchdb 2.1.2:

2020-08-07 23:21:13.738 ERROR [http-nio-8080-exec-24][IncludeTag:128] Current URL /couchdb-lucene/local/sw360users/_design/lucene/all?include_docs=true&limit=150&q=%28+type%3Auser+%29+AND+%28%22test*%22+test*%29 generates exception: null
java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:524)
	at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:173)
	at com.liferay.portal.kernel.io.OutputStreamWriter.write(OutputStreamWriter.java:119)
	at com.liferay.portal.kernel.io.unsync.UnsyncPrintWriter.write(UnsyncPrintWriter.java:350)
	at freemarker.ext.jsp.JspWriterAdapter.write(JspWriterAdapter.java:169)
	at com.liferay.portal.kernel.io.unsync.UnsyncPrintWriter.write(UnsyncPrintWriter.java:350)
	at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:199)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
	at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:201)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
	at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:406)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:382)
	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
	at freemarker.ext.jsp.TagTransformModel$TagWriter.endEvaluation(TagTransformModel.java:400)
	at freemarker.ext.jsp.TagTransformModel$TagWriter.afterBody(TagTransformModel.java:388)
	at freemarker.core.Environment.visitAndTransform(Environment.java:427)
2020-08-07 23:21:13.739 ERROR [http-nio-8080-exec-24][PasswordModifiedFilter:62] java.lang.IllegalStateException: Cannot forward after response has been committed
java.lang.IllegalStateException: Cannot forward after response has been committed

@JaideepPalit
Copy link
Contributor Author

Added Steps to deploy couchdb-lucene in description

@mcjaeger mcjaeger self-requested a review August 10, 2020 22:39
Copy link
Contributor

@mcjaeger mcjaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with couchdb 2.1.2 and couchdb lucene 2.1 and tested with cocuhdb 1.6 (?, whatever is there on xenial) and lucene 1.0.2 both work

@mcjaeger
Copy link
Contributor

actually, installing couchdblucene is quite an adventure, thanks @JaideepPalit for the steps, I also missed to rename the servlet war file at first attempt :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs code review needs general test This is general testing, meaning that there is no org specific issue to check for
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants