Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A6711200CA9 for ; Thu, 1 Jun 2017 11:58:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A317F160BB5; Thu, 1 Jun 2017 09:58:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EAE97160BC4 for ; Thu, 1 Jun 2017 11:58:08 +0200 (CEST) Received: (qmail 87282 invoked by uid 500); 1 Jun 2017 09:58:08 -0000 Mailing-List: contact oak-issues-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-issues@jackrabbit.apache.org Received: (qmail 87219 invoked by uid 99); 1 Jun 2017 09:58:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2017 09:58:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AC0581AFB14 for ; Thu, 1 Jun 2017 09:58:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id cNOzVji1m93d for ; Thu, 1 Jun 2017 09:58:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A618D5FB84 for ; Thu, 1 Jun 2017 09:58:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CDF90E0D9D for ; Thu, 1 Jun 2017 09:58:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4547021B5B for ; Thu, 1 Jun 2017 09:58:04 +0000 (UTC) Date: Thu, 1 Jun 2017 09:58:04 +0000 (UTC) From: "Stefan Egli (JIRA)" To: oak-issues@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OAK-6276) expose way to detect "eventual consistency delay" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 01 Jun 2017 09:58:09 -0000 [ https://issues.apache.org/jira/browse/OAK-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16032722#comment-16032722 ] Stefan Egli commented on OAK-6276: ---------------------------------- bq. Maybe we can come up with a less restrictive way of achieving the same by using "sync points" instead of "revision tokens" Sounds good. Maybe we should indeed not use the term "revision token" at all then in the API. We can use "sync points" instead. Or, we can go back to what [~catholicon] suggested initially and call it very generally "visibility token"? {noformat} String getVisibilityToken(); boolean isVisible(String visibilityToken, long waitTimeoutMillis); {noformat} > expose way to detect "eventual consistency delay" > ------------------------------------------------- > > Key: OAK-6276 > URL: https://issues.apache.org/jira/browse/OAK-6276 > Project: Jackrabbit Oak > Issue Type: New Feature > Components: api > Reporter: Stefan Egli > > I have a requirement to support an external messaging channel (eg Kafka) between Oak-based instances of the same cluster. As part of handling those messages the target instance in some cases might have to access data from the repository. > Now with DocumentNodeStore's eventual consistency that data might not 'travel' from the source to the target instance as fast as is the case for the external message. > Therefore the need arises to be able to delay such messages (on the target instance) until the repository sees (at least) the data the source instance wrote when sending off the message. > This ticket is to equip Oak with any feasible way for higher level code to generally speaking detect such an "eventual consistency delay". > One simple idea that comes to mind is to expose the current _head revision vector_ (or that from a particular session, but that might not be required, ie be too complicated). The source instance could get the local head revision vector, piggyback that on the message, then that could be compared on the target instance with its head state. If that turns out to be older, then it could do a wait and retry. (Nicer would of course be if there would even be a call-back - but in theory that could also be implemented ontop of an Observer). > One means to expose the head revision vector would be via a repository descriptor (which on access returns the current value, similar to [how discovery-lite does it|https://github.com/apache/jackrabbit-oak/blob/2634dbde9aedc2549f0512285e9abee5858b256f/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentDiscoveryLiteService.java#L246]). And the format could be normalized as eg {{longs}} (eg {{\[1496071927014, 1496071926243]}} (instead of {{\["r15c54d532ec-0-1", "r15c54d532ec-0-2"]}} to avoid leaking the revision format explicitly). -- This message was sent by Atlassian JIRA (v6.3.15#6346)