[jira] [Closed] (COUCHDB-804) Rename couch_file:make_blocks to couch_file:add_block_prefixes

2011-11-28 Thread Andrey Somov (Closed) (JIRA)

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

Andrey Somov closed COUCHDB-804.


Resolution: Not A Problem

No need to fix

> Rename couch_file:make_blocks to  couch_file:add_block_prefixes
> ---
>
> Key: COUCHDB-804
> URL: https://issues.apache.org/jira/browse/COUCHDB-804
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Documentation
>    Reporter: Andrey Somov
>Priority: Trivial
> Attachments: couch_file-patch1.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Rename couch_file:make_blocks to  couch_file:add_block_prefixes to be 
> symmetrical with  its counterpart - couch_file:remove_block_prefixes
> Add a few descriptions for functions

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Closed] (COUCHDB-983) Add a test for replication document fields

2011-10-31 Thread Andrey Somov (Closed) (JIRA)

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

Andrey Somov closed COUCHDB-983.


Resolution: Invalid

> Add a test for replication document  fields
> ---
>
> Key: COUCHDB-983
> URL: https://issues.apache.org/jira/browse/COUCHDB-983
> Project: CouchDB
>  Issue Type: Test
>  Components: Test Suite
> Environment: branch 1.1.x
>Reporter: Andrey Somov
>Priority: Trivial
> Attachments: json-patch-983.txt
>
>
> 1) remove redundant code
> 2) add a test for recently added replication document  fields (revision 
> 1038172)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: The Little Library

2011-10-24 Thread Andrey Somov
*>Requirements: Java , and a
modern internet browser like Google Chrome .
If you have a LAN firewall enabled, this installation may not work.*

Why is Java reqiured ?

-
Andrey


Re: Git to SVN

2011-10-07 Thread Andrey Somov
I have finally solved the problem. Thanks to everyone.

(It was a very weird DNS configuration which does not resolve a name if SSH
is used. Once I started to use the IP address, I could connect to the
server)

>
>
> Then you should do something wrong. Works here.
>
> - benoit
>


Re: Git to SVN

2011-10-07 Thread Andrey Somov
> git-scm.org is your friend.
>
>
> Tried.


>
> there are the setting http.proxy to configure git with a proxy. You can
> apply it globally or per repository.
>
> Tried.

-
Andrey


Re: Git to SVN

2011-10-07 Thread Andrey Somov
>The only platform I know of where git works less than brilliantly is
>Windows, which ones are you struggling with?
I think the picture is slightly different. On Windows, Git is just ugly and
awful, you have to install and configure a zillion of tools to get finally
_incomplete_ support. I do not want to start a DVCS war here. It is not the
proper place. And I do not argue the decision to use Git for CouchDB. I just
want to get up-to-date sources.
Yes, I tried Windows and I failed.

The main platform is Ubuntu 11.04. Only here I can really run the etap
tests.
I am afraid the real problem is that the proxy setting is not respected
somewhere. Because I _could_ clone the Git repository via an Eclipse plugin
(pure Java Git implementation) using Eclipse's proxy definition. But the
quality of the Eclipse plugin is so low that I could not go any further.
When I try the command line, Git fails to connect to the server. All the
other applications work properly. Git is installed via the standard Ubuntu
way.

I even tryed the 'hg-git' to get the sources via Mercurial (because
Mercurial works for me like a charm on both Ubuntu and Windows).
Unfortunately, it also has the problems with proxy definition.

I do not want to waste your time trying to solve it.

I just want to know whether I can somehow get access to the latest source.

-
Andrey


Re: Git to SVN

2011-10-07 Thread Andrey Somov
You cannot imagine how many attempts I have tried :)
For 2 days I have been busy installing, re-installing, configuring, trying,
asking, crying, crying, crying.
No progress.

But I got the message. I thought it was possible (while keeping the public
access as read-only) to port the changes as the batch process on the SVN
server. But this must be a general task for Apache.

-
Andrey


Git to SVN

2011-10-07 Thread Andrey Somov
Hi all,
the source code is now maintained in Git.
But what about SVN ? Does it stay ? Are the changes ported (back) to SVN ?

My problem is that I cannot use Git. In a corporate environment (with a
proxy and firewall) and in a mixture of operating systems Git works just
awful.
Despite of the help of my colleges (who use Git outside of our work
environment) I could not manage even to clone anything form a remote
repository.
If the changes are ported to SVN I can still follow the development.

-
Andrey


[jira] [Commented] (COUCHDB-1285) Allow configuration of vendor and module version in the welcome message

2011-10-03 Thread Andrey Somov (Commented) (JIRA)

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

Andrey Somov commented on COUCHDB-1285:
---

+1 to have just one vendor

> Allow configuration of vendor and module version in the welcome message
> ---
>
> Key: COUCHDB-1285
> URL: https://issues.apache.org/jira/browse/COUCHDB-1285
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Jan Lehnardt
> Attachments: vendor_and_modules_objects.patch
>
>
> The patch below allows to configure vendor and module version information 
> into the GET / welcome message.
> E.g.
>   [vendor]
>   name = refuge
>   version = 2.0.0
>   
>   [modules]
>   geocouch = 1.2.1
> would produce:
>   
> {"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geocouch":"1.2.1"}}
> --
> --- a/src/couchdb/couch_httpd_misc_handlers.erl
> +++ b/src/couchdb/couch_httpd_misc_handlers.erl
> @@ -30,9 +30,23 @@
>  % httpd global handlers
>  
>  handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
> +Vendor = case couch_config:get("vendor") of
> +  [] -> [];
> +  Vendor1 -> [{
> +proplists:get_value("name", Vendor1),
> +?l2b(proplists:get_value("version", Vendor1))
> +  }]
> +end,
> +
> +Modules = lists:map(fun({Key, Value}) ->
> +  {Key, ?l2b(Value)}
> +end, couch_config:get("modules")),
> +
>  send_json(Req, {[
>  {couchdb, WelcomeMessage},
> -{version, list_to_binary(couch_server:get_version())}
> +{version, list_to_binary(couch_server:get_version())}]
> +++ Vendor
> +++ [{modules, {Modules}}
>  ]});
>  handle_welcome_req(Req, _) ->
>  send_method_not_allowed(Req, "GET,HEAD").
> -- 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1285) Allow configuration of vendor and module version in the welcome message

2011-10-03 Thread Andrey Somov (Commented) (JIRA)

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

Andrey Somov commented on COUCHDB-1285:
---

>how to register these modules ? 
I did not quite catch you. As far as I understand this is a pure configuration 
change, which is going to be exposed only via the welcome message.

> Allow configuration of vendor and module version in the welcome message
> ---
>
> Key: COUCHDB-1285
> URL: https://issues.apache.org/jira/browse/COUCHDB-1285
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Jan Lehnardt
> Attachments: vendor_and_modules_objects.patch
>
>
> The patch below allows to configure vendor and module version information 
> into the GET / welcome message.
> E.g.
>   [vendor]
>   name = refuge
>   version = 2.0.0
>   
>   [modules]
>   geocouch = 1.2.1
> would produce:
>   
> {"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geocouch":"1.2.1"}}
> --
> --- a/src/couchdb/couch_httpd_misc_handlers.erl
> +++ b/src/couchdb/couch_httpd_misc_handlers.erl
> @@ -30,9 +30,23 @@
>  % httpd global handlers
>  
>  handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
> +Vendor = case couch_config:get("vendor") of
> +  [] -> [];
> +  Vendor1 -> [{
> +proplists:get_value("name", Vendor1),
> +?l2b(proplists:get_value("version", Vendor1))
> +  }]
> +end,
> +
> +Modules = lists:map(fun({Key, Value}) ->
> +  {Key, ?l2b(Value)}
> +end, couch_config:get("modules")),
> +
>  send_json(Req, {[
>  {couchdb, WelcomeMessage},
> -{version, list_to_binary(couch_server:get_version())}
> +{version, list_to_binary(couch_server:get_version())}]
> +++ Vendor
> +++ [{modules, {Modules}}
>  ]});
>  handle_welcome_req(Req, _) ->
>  send_method_not_allowed(Req, "GET,HEAD").
> -- 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1285) Allow configuration of vendor and module version in the welcome message

2011-09-16 Thread Andrey Somov (JIRA)

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

Andrey Somov commented on COUCHDB-1285:
---

It can also be extended:
"vendor":{"name":"refuge", "version": "2.0.0", "url": 
"http://www.couchbase.com/";, "logo_url" : 
"http://www.couchbase.com/img/logo.png"} 

> Allow configuration of vendor and module version in the welcome message
> ---
>
> Key: COUCHDB-1285
> URL: https://issues.apache.org/jira/browse/COUCHDB-1285
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Jan Lehnardt
>
> The patch below allows to configure vendor and module version information 
> into the GET / welcome message.
> E.g.
>   [vendor]
>   name = refuge
>   version = 2.0.0
>   
>   [modules]
>   geocouch = 1.2.1
> would produce:
>   
> {"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geocouch":"1.2.1"}}
> --
> --- a/src/couchdb/couch_httpd_misc_handlers.erl
> +++ b/src/couchdb/couch_httpd_misc_handlers.erl
> @@ -30,9 +30,23 @@
>  % httpd global handlers
>  
>  handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
> +Vendor = case couch_config:get("vendor") of
> +  [] -> [];
> +  Vendor1 -> [{
> +proplists:get_value("name", Vendor1),
> +?l2b(proplists:get_value("version", Vendor1))
> +  }]
> +end,
> +
> +Modules = lists:map(fun({Key, Value}) ->
> +  {Key, ?l2b(Value)}
> +end, couch_config:get("modules")),
> +
>  send_json(Req, {[
>  {couchdb, WelcomeMessage},
> -{version, list_to_binary(couch_server:get_version())}
> +{version, list_to_binary(couch_server:get_version())}]
> +++ Vendor
> +++ [{modules, {Modules}}
>  ]});
>  handle_welcome_req(Req, _) ->
>  send_method_not_allowed(Req, "GET,HEAD").
> -- 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (COUCHDB-1285) Allow configuration of vendor and module version in the welcome message

2011-09-16 Thread Andrey Somov (JIRA)

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

Andrey Somov commented on COUCHDB-1285:
---

+1 for this patch. (it would be also useful to show this info in Futon)

> Allow configuration of vendor and module version in the welcome message
> ---
>
> Key: COUCHDB-1285
> URL: https://issues.apache.org/jira/browse/COUCHDB-1285
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Jan Lehnardt
>
> The patch below allows to configure vendor and module version information 
> into the GET / welcome message.
> E.g.
>   [vendor]
>   name = refuge
>   version = 2.0.0
>   
>   [modules]
>   geocouch = 1.2.1
> would produce:
>   
> {"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geocouch":"1.2.1"}}
> --
> --- a/src/couchdb/couch_httpd_misc_handlers.erl
> +++ b/src/couchdb/couch_httpd_misc_handlers.erl
> @@ -30,9 +30,23 @@
>  % httpd global handlers
>  
>  handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
> +Vendor = case couch_config:get("vendor") of
> +  [] -> [];
> +  Vendor1 -> [{
> +proplists:get_value("name", Vendor1),
> +?l2b(proplists:get_value("version", Vendor1))
> +  }]
> +end,
> +
> +Modules = lists:map(fun({Key, Value}) ->
> +  {Key, ?l2b(Value)}
> +end, couch_config:get("modules")),
> +
>  send_json(Req, {[
>  {couchdb, WelcomeMessage},
> -{version, list_to_binary(couch_server:get_version())}
> +{version, list_to_binary(couch_server:get_version())}]
> +++ Vendor
> +++ [{modules, {Modules}}
>  ]});
>  handle_welcome_req(Req, _) ->
>  send_method_not_allowed(Req, "GET,HEAD").
> -- 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: community of CouchDB developers in the Netherlands

2011-09-16 Thread Andrey Somov
Thank you Randall.
Even though I have read a lot about the gen_server  I still have a lot of
difficulties to understand both the big picture and the small details of the
implementation.
That is why I was hoping to find someone who can guide me in the very
beginning.
In person it can be so much easier...
Apparently, here in the Netherlands Erlang is not that popular. (which is
also an indication that it should be impossible to find a job with Erlang)

Cheers,
Andrey

On Thu, Sep 15, 2011 at 6:45 PM, Randall Leeds wrote:

> On Thu, Sep 15, 2011 at 05:38, Andrey Somov  >wrote:
>
> > Thank you very much for your time and efforts.
> > It helped me to understand something but for each explanation I got 10
> new
> > questions :)
> >
> > Just the first one.
> >
> > *>> open_async(Server, From, DbName, Filepath, Options) ->
> > >>Parent = self(),
> > >>
> > >First, store the current process ID so it can be accessed later on, from
> a
> > >closure running in another process.*
> >
> > There is only one couch_server process. It is created like this:
> > gen_server:start_link({local, couch_server}, couch_server, [], []).
> >
> > As far as I understand it means that there is no need to remember the
> > process ID (Parent), and instead of
> > gen_server:call(
> >Parent, {open_result, DbName, Res, Options}, infinity
> >),
> >
> > we can use
> >
> > gen_server:call(
> >couch_server, {open_result, DbName, Res, Options},
> infinity
> >),
> >
> > I have many more but to avoid misunderstanding I would propose to stop
> > here.
> > I will try to dig further myself.
> > When I have specific questions I will try to approach this list.
> >
> > Thank you !
> >
>
> Andrey,
>
> This is exactly right. Although, the 'safer' thing to do which makes
> refactoring easy is to use the special constant ?MODULE to refer to the
> name
> of the current module.
> More than one way to get things done :)
>


Re: community of CouchDB developers in the Netherlands

2011-09-15 Thread Andrey Somov
Thank you very much for your time and efforts.
It helped me to understand something but for each explanation I got 10 new
questions :)

Just the first one.

*>> open_async(Server, From, DbName, Filepath, Options) ->
>>Parent = self(),
>>
>First, store the current process ID so it can be accessed later on, from a
>closure running in another process.*

There is only one couch_server process. It is created like this:
gen_server:start_link({local, couch_server}, couch_server, [], []).

As far as I understand it means that there is no need to remember the
process ID (Parent), and instead of
gen_server:call(
Parent, {open_result, DbName, Res, Options}, infinity
),

we can use

gen_server:call(
couch_server, {open_result, DbName, Res, Options}, infinity
),

I have many more but to avoid misunderstanding I would propose to stop here.
I will try to dig further myself.
When I have specific questions I will try to approach this list.

Thank you !

-
Andrey


Re: community of CouchDB developers in the Netherlands

2011-09-14 Thread Andrey Somov
Hi Dirkjan,
when I see the code like the one below (couch_server) I realize that I do
not understand the complete picture.
I do not get what is linked with what at the end.
I am wondering if someone can go through the code and explain it line by
line.
And I have severe difficulties to organize a working Erlang environment.

Do you have plans to attend any local conference in the nearest future ? (by
the way I live in Den Haag)


open_async(Server, From, DbName, Filepath, Options) ->
Parent = self(),
Opener = spawn_link(fun() ->
Res = couch_db:start_link(DbName, Filepath, Options),
gen_server:call(
Parent, {open_result, DbName, Res, Options}, infinity
),
unlink(Parent),
case Res of
{ok, DbReader} ->
unlink(DbReader);
_ ->
ok
end
end),
true = ets:insert(couch_dbs_by_name, {DbName, {opening, Opener,
[From]}}),
true = ets:insert(couch_dbs_by_pid, {Opener, DbName}),
DbsOpen = case lists:member(sys_db, Options) of
true ->
true = ets:insert(couch_sys_dbs, {DbName, true}),
Server#server.dbs_open;
false ->
Server#server.dbs_open + 1
end,
Server#server{dbs_open = DbsOpen}.


On Wed, Sep 14, 2011 at 7:01 PM, Dirkjan Ochtman  wrote:

> On Wed, Sep 14, 2011 at 18:54, Andrey Somov 
> wrote:
> > I would be happy to join a meetup of CouchDB developers.
> > Googling did not help to find either CouchDB or Erlang community here in
> the
> > Netherlands. Can someone help me ? Is there one ?
>
> There are a few Dutchies involved with CouchDB, but I don't think
> there's been much actual contribution in terms of Erlang code. AFAIK,
> most of us just use CouchDB in one way or another (or help out around
> the edges; couchdb-python, paisley, Futon).
>
> Cheers,
>
> Dirkjan
>


community of CouchDB developers in the Netherlands

2011-09-14 Thread Andrey Somov
Hi all,
I do my best to learn the internals of CouchDB.
Even though I could already identify some places to be improved
(COUCHDB-920, COUCHDB-800) I still feel myself lost when I read the Erlang
source.

Since I do not want to bombard this list with a zillion of stupid questions
I am wondering if there is a developers community in the Netherlands (where
I live).

I would be happy to join a meetup of CouchDB developers.
Googling did not help to find either CouchDB or Erlang community here in the
Netherlands. Can someone help me ? Is there one ?


Thanks,
Andrey


Re: more dynamic _sidebar.html

2011-09-03 Thread Andrey Somov
> >> Isn't it better to extend the JSON like this:
> >> {
> >> "couchdb": "Welcome",
> >> "version": "0.11.0",
> >> "name": "Apache CouchDB",
> >> "url": "http://couchdb.apache.org/";
> >> "logoSrc": "image/logo.png"
> >> "logoAlt": "Apache CouchDB: Relax"
> >> }
>
> Nope, I think this is a bad use of the root JSON document.
>
> Can you please be more descriptive ? What do you by 'bad' ? Do you mean it
is bad to extend the current document or do you mean it is generally bad ?
If the version is dynamic what is wrong to make the other parts of the
identity also dynamic ?

-
Andrey


more dynamic _sidebar.html

2011-09-02 Thread Andrey Somov
Hi all,
at the moment Futon (on _sidebar.html) shows the version taken from
http://wiki.apache.org/couchdb/HttpGetRoot

Isn't it better to extend the JSON like this:
{
"couchdb": "Welcome",
"version": "0.11.0",
"name": "Apache CouchDB",
"url": "http://couchdb.apache.org/";
"logoSrc": "image/logo.png"
"logoAlt": "Apache CouchDB: Relax"
}

This way if someone decides to change the logo for internal site it will
only require to change the config.

-
Andrey


Re: wrong case in Last-Modified

2011-08-24 Thread Andrey Somov
>
> > (but I would not mind if someone would change it to look perfect :)
>
> Patches welcome!
>

I am sorry. I looked in the source and the header is generated by mochiweb.


Re: wrong case in Last-Modified

2011-08-24 Thread Andrey Somov
Thank you.
(but I would not mind if someone would change it to look perfect :)


wrong case in Last-Modified

2011-08-24 Thread Andrey Somov
Hi all,
I have noticed that the HTTP header contains lower case value for
'Last-Modified'
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29)

~$ wget -q -O - "$@"http://localhost:5984/favicon.ico --proxy=off
--server-response
  HTTP/1.0 200 OK
  Server: CouchDB/1.2.0a-1151390 (Erlang OTP/R13B03)
  last-modified: Tue, 26 Jul 2011 04:19:47 GMT
  Expires: Fri, 24 Aug 2012 15:02:33 GMT
  Date: Wed, 24 Aug 2011 15:02:33 GMT
  Content-Type: image/x-icon
  Content-Length: 9326
  Cache-Control: public, max-age=31536000

By the way, the protocol in the reply is HTTP 1.0. Does it mean that CouchDB
does not support HTTP 1.1 ?

-
Andrey


Re: duplicate erlang files: mochijson2.erl and mochinum.erl

2011-06-28 Thread Andrey Somov
Thank you.

I noticed it because erlIDE cannot compile the source.

-
Andrey


duplicate erlang files: mochijson2.erl and mochinum.erl

2011-06-28 Thread Andrey Somov
Hi all,
the trunk contains now duplicates for 2 Erlang files: mochijson2.erl and
mochinum.erl
They reside both in 'ejson' and in 'mochiweb' folders.

The content is almost identical (just two lines are swapped)

Is it intentional ?

-
Andrey


Re: How to run a single etap test, and how to see io:format()

2011-06-27 Thread Andrey Somov
Done.

On Mon, Jun 27, 2011 at 4:49 PM, Paul Davis wrote:

> On Mon, Jun 27, 2011 at 9:42 AM, Andrey Somov 
> wrote:
> > Thank you Paul.
> > Should it be added to the documentation ?
> >
> > Andrey
> >
>
> You could add it at [1] if you like.
>
> http://wiki.apache.org/couchdb/Test_procedure
>


Re: How to run a single etap test, and how to see io:format()

2011-06-27 Thread Andrey Somov
Thank you Paul.
Should it be added to the documentation ?

Andrey


How to run a single etap test, and how to see io:format()

2011-06-27 Thread Andrey Somov
Hi all,
I wanted to know how couch_key_tree:merge() works running 060-kt-merging.t
from trunk.

While looking in the documentation I could not find the answer to a couple
of questions:

1) How can I see the outcome of io:format() in a etap test ?
2) how can I run a single etap test ?

Thank you,
Andrey


[jira] [Updated] (COUCHDB-1196) The server cannot terminate properly closing all the databases

2011-06-15 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-1196:
--

Attachment: patch-issue-1196.txt

> The server cannot terminate properly closing all the databases
> --
>
> Key: COUCHDB-1196
> URL: https://issues.apache.org/jira/browse/COUCHDB-1196
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core
>Affects Versions: 1.2
>Reporter: Andrey Somov
>Priority: Minor
> Attachments: patch-issue-1196.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> It looks like the values in the couch_dbs_by_name table are tuples of 2
> terms in couch_server.terminate():
> terminate(_Reason, _Srv) ->
> [couch_util:shutdown_sync(Pid) || {_, {Pid, _LruTime}} <-
> ets:tab2list(couch_dbs_by_name)],
> ok.
> But in the rest of the code the values are always 3-term-tuples:
> {opened, Pid, LruTime} or {opening, Opener, [Froms]}
> The patch is expected to solve the issue. All the tests pass.
> See also: http://thread.gmane.org/gmane.comp.db.couchdb.devel/15741

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Created] (COUCHDB-1196) The server cannot terminate properly closing all the databases

2011-06-15 Thread Andrey Somov (JIRA)
The server cannot terminate properly closing all the databases
--

 Key: COUCHDB-1196
 URL: https://issues.apache.org/jira/browse/COUCHDB-1196
 Project: CouchDB
  Issue Type: Bug
  Components: Database Core
Affects Versions: 1.2
Reporter: Andrey Somov
Priority: Minor


It looks like the values in the couch_dbs_by_name table are tuples of 2
terms in couch_server.terminate():

terminate(_Reason, _Srv) ->
[couch_util:shutdown_sync(Pid) || {_, {Pid, _LruTime}} <-
ets:tab2list(couch_dbs_by_name)],
ok.

But in the rest of the code the values are always 3-term-tuples:

{opened, Pid, LruTime} or {opening, Opener, [Froms]}

The patch is expected to solve the issue. All the tests pass.

See also: http://thread.gmane.org/gmane.comp.db.couchdb.devel/15741

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: couch_server.erl - is couch_dbs_by_name table correclty used in terminate() function ?

2011-06-15 Thread Andrey Somov
My problem is that I never managed to pass ALL the tests. Some of the tests
(both Etap and JavaScript) fail in trunk and in branches. (I even came to
the conclusion that developers do not run all the tests before each and
every commit.)
That is why I cannot really trust the patch I can provide.

In the past, I have already created a few JIRA issues with patches. None of
them is accepted.

Taking all this into account I think it is better if someone else can change
the code.

Thank you for the help.
Andrey


Re: couch_server.erl - is couch_dbs_by_name table correclty used in terminate() function ?

2011-06-15 Thread Andrey Somov
The bug has been introduced more then a year ago (02-Apr-2010) in revision
930363 with the comment "Deterministic/synchronous shutdown code"

Since no one is complaining may be the code is redundant and it can be
safely removed ?
(the less code the better)

-
Andrey


couch_server.erl - is couch_dbs_by_name table correclty used in terminate() function ?

2011-06-15 Thread Andrey Somov
Hi all,
when I read the code in couch_server.terminate() function I see the
following in the trunk:

terminate(_Reason, _Srv) ->
[couch_util:shutdown_sync(Pid) || {_, {Pid, _LruTime}} <-
ets:tab2list(couch_dbs_by_name)],
ok.

It looks like the values in the couch_dbs_by_name table are tuples of 2
terms.
But when I read the rest of the code I see that the values are always
3-term-tuples:

{opened, Pid, LruTime} or {opening, Opener, [Froms]}

I must admit I do not understand how the code in the terminate() may work.
Is it just a bug ?


-
Andrey


Re: Development environment

2011-04-29 Thread Andrey Somov
Hi Robert,
unfortunately, I could not build distel (on Ubuntu 10.04):

trop:~/distel-bdionne$ erl
Erlang R13B03 (erts-5.7.4) [source] [rq:1] [async-threads:0] [hipe]
[kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1>

trop:~/distel-bdionne$ make --debug
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i486-pc-linux-gnu
Reading makefiles...
Updating goal targets
 File `base' does not exist.
   File `ebin/distel.beam' does not exist.
  Must remake target `ebin/distel.beam'.
erlc -W -o ebin +debug_info src/distel.erl
/home/trop/distel-bdionne/ebin/distel.bea#: error writing file
make: *** [ebin/distel.beam] Error 1


Re: Development environment

2011-04-29 Thread Andrey Somov
Hello Robert,
this is much closer to what I expect.
I assume I should follow the procedure described here
http://mail-archives.apache.org/mod_mbox/couchdb-dev/200811.mbox/%3cc397e43f-096f-4892-9519-383032622...@dionne-associates.com%3E

I will give it a try.
Thank you very much.
-
Andrey

P.S. I have already identified some redundant code (
https://issues.apache.org/jira/browse/COUCHDB-920).
I hope I can further improve the code base when I am able to debug the
running database.



On Fri, Apr 29, 2011 at 1:34 PM, Robert Dionne  wrote:

> Hi Andrey,
>
>  I use Distel[1] (Distributed emacs lisp for Erlang), a set of emacs
> extensions that create a full development environment for Erlang. It
> connects to a running node so one gets full access to the syntax_tools and
> source code of Erlang, all at run time. As this brief white paper points out
> it goes further than typical elisp hacks as it imports the Erlang
> distributed model into emacs. I keep hoping to find some time to push it a
> little further and provide better support for working with BigCouch, our
> clustered CouchDB at Cloudant.
>
>  I keep up my own fork of it as there aren't too many of us out there and I
> needed to fix a few things. I also include in that project some tweaks to
> the Erlang mode that ships with Erlang to accommodate the CouchDB format
> conventions. It provides a full symbolic debugging environment. Though it's
> useful and I think I've found a few CouchDB bugs with it, given the nature
> of OTP programming it's a little harder when you have breakpoints that hit
> 50 processes. It was great for stepping thru the btree code.
>
>  The most useful features are the navigation (M-. M-,) and who_calls (C-c
> C-d w) The lack of use of who_calls I believe is the major reason we often
> discover dead code that's been there forever. As an aside the use of type
> specs and dialyzer go a long way towards finding errors at compile time.
>
> Regards,
>
> Bob
>
> [1] https://github.com/bdionne/distel/raw/master/doc/gorrie02distel.pdf
> [2] https://github.com/bdionne/distel
>
>
>
>


[jira] [Updated] (COUCHDB-1148) Remove unused single backslash from a regular expression in couch_config_writer.erl

2011-04-29 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-1148:
--

Attachment: patch-1148.txt

> Remove unused single backslash from a regular expression in 
> couch_config_writer.erl
> ---
>
> Key: COUCHDB-1148
> URL: https://issues.apache.org/jira/browse/COUCHDB-1148
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Database Core
>Affects Versions: 1.1
>    Reporter: Andrey Somov
>Priority: Minor
> Attachments: patch-1148.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The pattern re:compile(["^(", Key, "\\s*=)|\\[[a-zA-Z0-9\_-]*\\]"]) contains 
> a single backslash '\_' which can be removed.
> http://comments.gmane.org/gmane.comp.db.couchdb.devel/14534

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (COUCHDB-1148) Remove unused single backslash from a regular expression in couch_config_writer.erl

2011-04-29 Thread Andrey Somov (JIRA)
Remove unused single backslash from a regular expression in 
couch_config_writer.erl
---

 Key: COUCHDB-1148
 URL: https://issues.apache.org/jira/browse/COUCHDB-1148
 Project: CouchDB
  Issue Type: Improvement
  Components: Database Core
Affects Versions: 1.1
Reporter: Andrey Somov
Priority: Minor


The pattern re:compile(["^(", Key, "\\s*=)|\\[[a-zA-Z0-9\_-]*\\]"]) contains a 
single backslash '\_' which can be removed.

http://comments.gmane.org/gmane.comp.db.couchdb.devel/14534


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: Development environment

2011-04-28 Thread Andrey Somov
On Fri, Apr 29, 2011 at 1:01 AM, Paul Davis wrote:

> On Thu, Apr 28, 2011 at 6:57 PM, Nathan Stott  wrote:
> > So couchdb is really developed without using step-by-step debugging at
> > all?  That seems quite odd.
> >
>
> I never use step by step debugging on any project in any language.
> I've never found it that useful.
>

step by step debugging of a unit test is one the most effective ways to find
bugs.

-
Andrey


Re: Development environment

2011-04-28 Thread Andrey Somov
On Thu, Apr 28, 2011 at 7:43 PM, Miles Fidelman
wrote:

> I'm not 100% sure, but I expect Erlide might fill the bill - it's an Erlang
> IDE that runs under Eclipse.  Now how much further that takes you into the
> guts of CouchDB is another story.
>
>
I tried to use erlIDE but I did not find a way to launch CouchDB.
Googling did not help and asking the question in this mailing list did not
help either.
As far as I understand no CouchDB developer is using erlIDE at the moment.

It looks like I have to keep using io:format.

-
Andrey


Re: Development environment

2011-04-28 Thread Andrey Somov
Thank you, but the question is not how to run but how to DEBUG (and watch
all the values, function calls etc)
Just the ability to run CouchDB does not help to understand who is calling
whom, when, how, with which arguments...

-
Andrey

On Thu, Apr 28, 2011 at 6:10 PM, Paul Davis wrote:

> On Thu, Apr 28, 2011 at 12:03 PM, Andrey Somov
>  wrote:
> > Hi all,
> > in order to understand how CouchDB works I want be able to run the
> > application under debugger. Unfortunately it does not look like an easy
> > task.
> > The information provided on the wiiki (
> > http://wiki.apache.org/couchdb/Running%20CouchDB%20in%20Dev%20Mode) may
> be
> > enough for a
> > professional Erlang developer but it is not enough for anyone who learns
> > Erlang together with CouchDB.
> > I could not find any resource which gives step-by-step instructions on
> how
> > to organise an effective development environment for CouchDB.
> >
> > Can someone point me to such a guide/tutorial/manual/screencast ?
> >
> > Thanks,
> > Andrey
> >
>
> Getting deps on Ubuntu (maybe debian?)
>
> $ sudo apt-get build-deps couchdb
>
> On OS X with Homebrew you should only need to do something like:
>
> $ brew install erlang
> $ brew install spidermonkey
> $ brew install icu4c && brew link icu4c
>
> Then for CouchDB:
>
> $ mkdir -p ~/code && cd code
> $ svn checkout http://svn.apache.org/repos/asf/couchdb/trunk couchdb
> $ # alternatively: git clone git://git.apache.org/couchdb.git
> $ cd couchdb
> $ ./bootstrap && ./configure && make dev
> $ ./utils/run
>


Development environment

2011-04-28 Thread Andrey Somov
Hi all,
in order to understand how CouchDB works I want be able to run the
application under debugger. Unfortunately it does not look like an easy
task.
The information provided on the wiiki (
http://wiki.apache.org/couchdb/Running%20CouchDB%20in%20Dev%20Mode) may be
enough for a
professional Erlang developer but it is not enough for anyone who learns
Erlang together with CouchDB.
I could not find any resource which gives step-by-step instructions on how
to organise an effective development environment for CouchDB.

Can someone point me to such a guide/tutorial/manual/screencast ?

Thanks,
Andrey


[jira] [Commented] (COUCHDB-1082) Fix a typo and confusing comment in 050-stream.t

2011-04-18 Thread Andrey Somov (JIRA)

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

Andrey Somov commented on COUCHDB-1082:
---

The code is not wrong. Just the syntax is a bit confusing.

> Fix a typo and confusing comment in 050-stream.t
> 
>
> Key: COUCHDB-1082
> URL: https://issues.apache.org/jira/browse/COUCHDB-1082
> Project: CouchDB
>  Issue Type: Test
>  Components: Test Suite
>Affects Versions: 1.1
>Reporter: Andrey Somov
>Priority: Trivial
>  Labels: test-patch
> Attachments: 1082-patch.txt, oneBits.jpg
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> The comment says "Successfully wrote 80 1 bits." while in fact they are 
> (almost) all zeros.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: couch_config_writer.erl: meaning of single backslash in regular expression

2011-04-08 Thread Andrey Somov
I was asking the question because I was not sure whether the Erlang's
dialect has a special meaning for "escaped" underscore.
I am afraid it is just a minor bug.
Shall I create an issue ?

-
Andrey

On Fri, Apr 8, 2011 at 1:20 PM, Dirkjan Ochtman  wrote:

> On Fri, Apr 8, 2011 at 13:16, Andrey Somov 
> wrote:
> > {ok, Pattern} = re:compile(["^(", Key, "\\s*=)|\\[[a-zA-Z0-9\_-]*\\]"]),
> >
> > What does the single backslash mean (\_)? When I remove it the tests
> still
> > succeed. (to be precise they fail in the same way as with the single
> > backslash)
>
> I'm guessing it's supposed to be an escape character, but I don't know
> of any regex dialect where the underscore is meaningful inside a
> character range.
>
> Cheers,
>
> Dirkjan
>


couch_config_writer.erl: meaning of single backslash in regular expression

2011-04-08 Thread Andrey Somov
Hi all,
the line 34 of couch_config_writer.erl (
https://svn.apache.org/repos/asf/couchdb/trunk/src/couchdb/couch_config_writer.erl
)
contains a regular expression:

{ok, Pattern} = re:compile(["^(", Key, "\\s*=)|\\[[a-zA-Z0-9\_-]*\\]"]),

What does the single backslash mean (\_)? When I remove it the tests still
succeed. (to be precise they fail in the same way as with the single
backslash)

-
Andrey


[jira] Updated: (COUCHDB-1091) Remove code dublication in couch_key_tree.erl

2011-03-15 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-1091:
--

Attachment: 1091-patch-key-tree.txt

> Remove code dublication in couch_key_tree.erl
> -
>
> Key: COUCHDB-1091
> URL: https://issues.apache.org/jira/browse/COUCHDB-1091
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Database Core
>Affects Versions: 1.1
>Reporter: Andrey Somov
>Priority: Minor
>  Labels: cleanup
> Attachments: 1091-patch-key-tree.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> couch_key_tree.erl has the same code in remove_leafs() and in stem()
> The patch introduces a reusable function

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] Created: (COUCHDB-1091) Remove code dublication in couch_key_tree.erl

2011-03-15 Thread Andrey Somov (JIRA)
Remove code dublication in couch_key_tree.erl
-

 Key: COUCHDB-1091
 URL: https://issues.apache.org/jira/browse/COUCHDB-1091
 Project: CouchDB
  Issue Type: Improvement
  Components: Database Core
Affects Versions: 1.1
Reporter: Andrey Somov
Priority: Minor


couch_key_tree.erl has the same code in remove_leafs() and in stem()

The patch introduces a reusable function

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: Tree::term() is really a tree()

2011-03-09 Thread Andrey Somov
Very clear. Thank you.


Tree::term() is really a tree()

2011-03-09 Thread Andrey Somov
Hi all,
I have found the following comment in the source (couch_db.hrl):

% Tree::term() is really a tree(), but we don't want to require R13B04 yet
-type branch() :: {Key::term(), Value::term(), Tree::term()}.

Does it mean that CouchDB includes its own copy of gb_trees.erl ?
Does it mean that CouchDB implements its own tree but the interface is
identical to gb_trees.erl and it will be changed once R13B04 is required ?


-
Andrey


debug CouchDB under erlIDE

2011-03-07 Thread Andrey Somov
Hi all,
has anyone managed to debug CouchDB under Eclipse ?

I can debug tests under 'test/etap' after translating them to Erlang
modules. But I could not manage to launch an application.

Which module should I launch ? couch_app ? couch_server_sup ?

Unfortunately, reading '
http://www.erlang.org/doc/design_principles/applications.html' does not help
much ...

Thank you,
Andrey


[jira] Updated: (COUCHDB-1082) Fix a typo and confusing comment in 050-stream.t

2011-03-05 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-1082:
--

Attachment: 1082-patch.txt
oneBits.jpg

The picture shows the contents of the 'OneBits' binary.


> Fix a typo and confusing comment in 050-stream.t
> 
>
> Key: COUCHDB-1082
> URL: https://issues.apache.org/jira/browse/COUCHDB-1082
> Project: CouchDB
>  Issue Type: Test
>  Components: Test Suite
>Affects Versions: 1.1
>Reporter: Andrey Somov
>Priority: Trivial
>  Labels: test-patch
> Attachments: 1082-patch.txt, oneBits.jpg
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> The comment says "Successfully wrote 80 1 bits." while in fact they are 
> (almost) all zeros.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Created: (COUCHDB-1082) Fix a typo and confusing comment in 050-stream.t

2011-03-05 Thread Andrey Somov (JIRA)
Fix a typo and confusing comment in 050-stream.t


 Key: COUCHDB-1082
 URL: https://issues.apache.org/jira/browse/COUCHDB-1082
 Project: CouchDB
  Issue Type: Test
  Components: Test Suite
Affects Versions: 1.1
Reporter: Andrey Somov
Priority: Trivial


The comment says "Successfully wrote 80 1 bits." while in fact they are 
(almost) all zeros.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Closed: (COUCHDB-917) Fix typos in comments

2010-12-10 Thread Andrey Somov (JIRA)

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

Andrey Somov closed COUCHDB-917.



> Fix typos in comments
> -
>
> Key: COUCHDB-917
> URL: https://issues.apache.org/jira/browse/COUCHDB-917
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Documentation
>Affects Versions: 1.0.1
>Reporter: Andrey Somov
>Priority: Minor
> Attachments: typos-in-comments.patch
>
>
> Apply proper spelling

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COUCHDB-983) Add a test for replication document fields

2010-12-10 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-983:
-

Attachment: json-patch-983.txt

> Add a test for replication document  fields
> ---
>
> Key: COUCHDB-983
> URL: https://issues.apache.org/jira/browse/COUCHDB-983
> Project: CouchDB
>  Issue Type: Test
>  Components: Test Suite
> Environment: branch 1.1.x
>Reporter: Andrey Somov
>Priority: Trivial
> Attachments: json-patch-983.txt
>
>
> 1) remove redundant code
> 2) add a test for recently added replication document  fields (revision 
> 1038172)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (COUCHDB-983) Add a test for replication document fields

2010-12-10 Thread Andrey Somov (JIRA)
Add a test for replication document  fields
---

 Key: COUCHDB-983
 URL: https://issues.apache.org/jira/browse/COUCHDB-983
 Project: CouchDB
  Issue Type: Test
  Components: Test Suite
 Environment: branch 1.1.x
Reporter: Andrey Somov
Priority: Trivial


1) remove redundant code
2) add a test for recently added replication document  fields (revision 1038172)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (COUCHDB-920) BTree: modify_node() and complete_root() functions do not make a new btree record

2010-10-15 Thread Andrey Somov (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921294#action_12921294
 ] 

Andrey Somov commented on COUCHDB-920:
--

Since the only value of the patch is to increase code readability it can 
certainly wait. (or even be dropped)
I have definitely spent more brain cycles trying to understand the redundant 
code. But the clean up may change the situation considerably.

> BTree: modify_node() and complete_root() functions do not make a new btree 
> record
> -
>
> Key: COUCHDB-920
> URL: https://issues.apache.org/jira/browse/COUCHDB-920
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Database Core
>Affects Versions: 1.0.1
>Reporter: Andrey Somov
>Priority: Minor
> Attachments: btree_issue920.patch
>
>
> BTree: modify_node() and complete_root() functions do not make a new btree 
> record. But nevertheless they return a btree as if it is different. The patch 
> simplifies the code and makes it clear that only query_modify() function 
> makes a new btree record.
> tests are OK.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COUCHDB-920) BTree: modify_node() and complete_root() functions do not make a new btree record

2010-10-14 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-920:
-

Attachment: btree_issue920.patch

> BTree: modify_node() and complete_root() functions do not make a new btree 
> record
> -
>
> Key: COUCHDB-920
> URL: https://issues.apache.org/jira/browse/COUCHDB-920
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Database Core
>Affects Versions: 1.0.1
>    Reporter: Andrey Somov
>Priority: Minor
> Attachments: btree_issue920.patch
>
>
> BTree: modify_node() and complete_root() functions do not make a new btree 
> record. But nevertheless they return a btree as if it is different. The patch 
> simplifies the code and makes it clear that only query_modify() function 
> makes a new btree record.
> tests are OK.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (COUCHDB-920) BTree: modify_node() and complete_root() functions do not make a new btree record

2010-10-14 Thread Andrey Somov (JIRA)
BTree: modify_node() and complete_root() functions do not make a new btree 
record
-

 Key: COUCHDB-920
 URL: https://issues.apache.org/jira/browse/COUCHDB-920
 Project: CouchDB
  Issue Type: Improvement
  Components: Database Core
Affects Versions: 1.0.1
Reporter: Andrey Somov
Priority: Minor


BTree: modify_node() and complete_root() functions do not make a new btree 
record. But nevertheless they return a btree as if it is different. The patch 
simplifies the code and makes it clear that only query_modify() function makes 
a new btree record.

tests are OK.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COUCHDB-917) Fix typos in comments

2010-10-13 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-917:
-

Attachment: typos-in-comments.patch

> Fix typos in comments
> -
>
> Key: COUCHDB-917
> URL: https://issues.apache.org/jira/browse/COUCHDB-917
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Documentation
>Affects Versions: 1.0.1
>Reporter: Andrey Somov
>Priority: Minor
> Attachments: typos-in-comments.patch
>
>
> Apply proper spelling

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (COUCHDB-917) Fix typos in comments

2010-10-13 Thread Andrey Somov (JIRA)
Fix typos in comments
-

 Key: COUCHDB-917
 URL: https://issues.apache.org/jira/browse/COUCHDB-917
 Project: CouchDB
  Issue Type: Improvement
  Components: Documentation
Affects Versions: 1.0.1
Reporter: Andrey Somov
Priority: Minor
 Attachments: typos-in-comments.patch

Apply proper spelling

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: escript tests

2010-09-28 Thread Andrey Somov
Thank you very much Chris ! I did not know about such a resource :)


Re: escript tests

2010-09-27 Thread Andrey Somov
> They're maintained, but they're not widely run outside the main
> committers. If you have issues or patches for them we'd be glad to
> have them so they run everywhere.
>
It was a problem with my setup.

>> 2. '020-btree-bacisc.t' test only works with big lists. When the
>> rows() method returns less then 40 then the test fail. Does it mean
>> that the BTree does not work with small portions of data ? May the
>> test be changed (or added) to be able to process 3-5 values because it
>> would be much more convenient to follow the execution with the
>> debugger ?
>>
>
> That's unintentional. I can't say I've ever tried running with a small
> number of rows. If its a simple change I'd be willing to add it. If it
> becomes a big change I'd probably ask you to add another test to
> exercise things with smaller numbers of rows.
>
I checked the test, but I could not locate the problem. If I can
identify the cause I will report it.

>... the best place to report them is in JIRA and not here.
No problem.

Thank you.
Andrey


[jira] Commented: (COUCHDB-800) Problem when writing larger than 4kb file headers

2010-09-27 Thread Andrey Somov (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915356#action_12915356
 ] 

Andrey Somov commented on COUCHDB-800:
--

But the issue has been fixed by Damian 3 months ago. I think I can try to 
deliver patches once I learn more about CouchDB internals.

> Problem when writing larger than 4kb file headers
> -
>
> Key: COUCHDB-800
> URL: https://issues.apache.org/jira/browse/COUCHDB-800
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core
>Affects Versions: 0.11
>Reporter: Damien Katz
>Assignee: Damien Katz
>     Fix For: 0.11.1, 0.12
>
>
> From Andrey Somov:
> Hi,
> while reading the CouchDB source I found a question in couch_file.erl,
> I am not sure whether it is a bug or not.
> Lines 297-311:
> handle_call({write_header, Bin}, _From, #file{fd=Fd, eof=Pos}=File) ->
>BinSize = size(Bin),
>case Pos rem ?SIZE_BLOCK of
>0 ->
>Padding = <<>>;
>BlockOffset ->
>Padding = <<0:(8*(?SIZE_BLOCK-BlockOffset))>>
>end,
>FinalBin = [Padding, <<1, BinSize:32/integer>> | make_blocks(1, [Bin])],
>case file:write(Fd, FinalBin) of
>ok ->
>{reply, ok, File#file{eof=Pos+iolist_size(FinalBin)}};
>Error ->
>{reply, Error, File}
>end;
> Because <<1, BinSize:32/integer>> occupies 5 bytes make_blocks() shall
> use offset=5, but the offset is only 1.
> (it should be make_blocks(5, [Bin]))
> Since the header is smaller then 4k there is no difference and it
> works (the tests succeed with both 1 and 5). But it makes it more
> difficult to understand the code for those who study the source to
> understand how it works.
> -
> Thank you,
> Andrey

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: escript tests

2010-09-27 Thread Andrey Somov
Thank you Chris. I have updated xulrunner (I am on Ubuntu) and all the
tests pass.

Unfortunately I cannot use FreeNode because I am behind a firewall.


escript tests

2010-09-27 Thread Andrey Somov
Hi all,
I like CouchDB and I would like to read its source to understand it better.
While reading the code I have already discovered places where it can
be improved (https://issues.apache.org/jira/browse/COUCHDB-800)

I find it very helpful to run and debug tests.

1. Some test fail - I get endless loop. Are the escript  tests
maintained ? (If yes I will try to find out what is wrong with my
setup)

2. '020-btree-bacisc.t' test only works with big lists. When the
rows() method returns less then 40 then the test fail. Does it mean
that the BTree does not work with small portions of data ? May the
test be changed (or added) to be able to process 3-5 values because it
would be much more convenient to follow the execution with the
debugger ?

3. If I find a place where the code may be improved shall I first
raise a question in this list or should I create an issue with a patch
and an explanation ?

--
Andrey


[jira] Updated: (COUCHDB-804) Rename couch_file:make_blocks to couch_file:add_block_prefixes

2010-06-17 Thread Andrey Somov (JIRA)

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

Andrey Somov updated COUCHDB-804:
-

Attachment: couch_file-patch1.txt

> Rename couch_file:make_blocks to  couch_file:add_block_prefixes
> ---
>
> Key: COUCHDB-804
> URL: https://issues.apache.org/jira/browse/COUCHDB-804
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Documentation
>    Reporter: Andrey Somov
>Priority: Trivial
> Attachments: couch_file-patch1.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Rename couch_file:make_blocks to  couch_file:add_block_prefixes to be 
> symmetrical with  its counterpart - couch_file:remove_block_prefixes
> Add a few descriptions for functions

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (COUCHDB-804) Rename couch_file:make_blocks to couch_file:add_block_prefixes

2010-06-17 Thread Andrey Somov (JIRA)
Rename couch_file:make_blocks to  couch_file:add_block_prefixes
---

 Key: COUCHDB-804
 URL: https://issues.apache.org/jira/browse/COUCHDB-804
 Project: CouchDB
  Issue Type: Improvement
  Components: Documentation
Reporter: Andrey Somov
Priority: Trivial
 Attachments: couch_file-patch1.txt

Rename couch_file:make_blocks to  couch_file:add_block_prefixes to be 
symmetrical with  its counterpart - couch_file:remove_block_prefixes

Add a few descriptions for functions

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



error in handle_call({write_header, Bin}

2010-06-15 Thread Andrey Somov
Hi,
while reading the CouchDB source I found a question in couch_file.erl,
I am not sure whether it is a bug or not.

Lines 297-311:

handle_call({write_header, Bin}, _From, #file{fd=Fd, eof=Pos}=File) ->
BinSize = size(Bin),
case Pos rem ?SIZE_BLOCK of
0 ->
Padding = <<>>;
BlockOffset ->
Padding = <<0:(8*(?SIZE_BLOCK-BlockOffset))>>
end,
FinalBin = [Padding, <<1, BinSize:32/integer>> | make_blocks(1, [Bin])],
case file:write(Fd, FinalBin) of
ok ->
{reply, ok, File#file{eof=Pos+iolist_size(FinalBin)}};
Error ->
{reply, Error, File}
end;


Because <<1, BinSize:32/integer>> occupies 5 bytes make_blocks() shall
use offset=5, but the offset is only 1.
(it should be make_blocks(5, [Bin]))

Since the header is smaller then 4k there is no difference and it
works (the tests succeed with both 1 and 5). But it makes it more
difficult to understand the code for those who study the source to
understand how it works.

-
Thank you,
Andrey