You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/07/11 23:25:47 UTC

[couchdb] branch optimize-ddoc-cache updated (f9fb65d -> 3aa1e0a)

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a change to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    from f9fb65d  FIXUP: Prevent dirty reads from cache
     new 38e54ee  TMP: soak-javascript target
     new 3aa1e0a  FIXUP: Move invalidation to ddoc_cache_entry

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Makefile                                | 15 +++++++++++++++
 src/ddoc_cache/src/ddoc_cache_entry.erl |  4 ++++
 src/ddoc_cache/src/ddoc_cache_lru.erl   |  5 -----
 3 files changed, 19 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].

[couchdb] 02/02: FIXUP: Move invalidation to ddoc_cache_entry

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3aa1e0a69eefee85007bec9c914271eb886717b8
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Jul 11 18:25:39 2017 -0500

    FIXUP: Move invalidation to ddoc_cache_entry
---
 src/ddoc_cache/src/ddoc_cache_entry.erl | 4 ++++
 src/ddoc_cache/src/ddoc_cache_lru.erl   | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/ddoc_cache/src/ddoc_cache_entry.erl b/src/ddoc_cache/src/ddoc_cache_entry.erl
index 0025904..85108e7 100644
--- a/src/ddoc_cache/src/ddoc_cache_entry.erl
+++ b/src/ddoc_cache/src/ddoc_cache_entry.erl
@@ -196,6 +196,10 @@ handle_cast(force_refresh, St) ->
     NewSt = if St#st.accessed > 0 -> St; true ->
         St#st{accessed = 1}
     end,
+    % We remove the cache entry value so that any
+    % new client comes to us for the refreshed
+    % value.
+    true = ets:update_element(?CACHE, St#st.key, {#entry.value, undefined}),
     handle_cast(refresh, NewSt);
 
 handle_cast(refresh, #st{accessed = 0} = St) ->
diff --git a/src/ddoc_cache/src/ddoc_cache_lru.erl b/src/ddoc_cache/src/ddoc_cache_lru.erl
index 2d8a371..82d7245 100644
--- a/src/ddoc_cache/src/ddoc_cache_lru.erl
+++ b/src/ddoc_cache/src/ddoc_cache_lru.erl
@@ -178,11 +178,6 @@ handle_cast({do_refresh, DbName, DDocIdList}, St) ->
                 case khash:lookup(DDocIds, DDocId) of
                     {value, Keys} ->
                         khash:fold(Keys, fun(Key, Pid, _) ->
-                            % We're erasing the value from cache here
-                            % so that new clients will wait for the
-                            % refresh to complete.
-                            Op = [{#entry.val, undefined}],
-                            true = ets:update_element(?CACHE, Key, Op),
                             ddoc_cache_entry:refresh(Pid)
                         end, nil);
                     not_found ->

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.

[couchdb] 01/02: TMP: soak-javascript target

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch optimize-ddoc-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 38e54ee12a501882b875eb6353bb60cd52422cdb
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Jul 11 18:25:12 2017 -0500

    TMP: soak-javascript target
---
 Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Makefile b/Makefile
index 9b1701e..1fba02c 100644
--- a/Makefile
+++ b/Makefile
@@ -124,6 +124,21 @@ endif
             -c 'startup_jitter=0' \
             test/javascript/run $(suites)
 
+.PHONY: soak-javascript
+soak-javascript:
+	@mkdir -p share/www/script/test
+ifeq ($(IN_RELEASE), true)
+	@cp test/javascript/tests/lorem*.txt share/www/script.test/
+else
+	@mkdir -p src/fauxton/dist/release/test
+	@cp test/javascript/tests/lorem*.txt src/fauxton/dist/release/test/
+endif
+	@rm -rf dev/lib
+	while [ $$? -eq 0 ]; do \
+		dev/run -n 1 -q --with-admin-party-please \
+				-c 'startup_jitter=0' \
+				test/javascript/run $(suites); \
+	done
 
 .PHONY: check-qs
 # target: check-qs - Run query server tests (ruby and rspec required!)

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.